comparison libvo/vo_directx.c @ 16968:e9d849bf8050

add a switch, slave command, and vo control to toggle borderless window. includes documentation.
author joey
date Thu, 10 Nov 2005 22:25:54 +0000
parents 46490266341d
children 78ac0dd386c0
comparison
equal deleted inserted replaced
16967:32e2c59c8e86 16968:e9d849bf8050
668 } 668 }
669 669
670 if(!vidmode && !vo_fs){ 670 if(!vidmode && !vo_fs){
671 if(WinID == -1) { 671 if(WinID == -1) {
672 RECT rdw=rd; 672 RECT rdw=rd;
673 if (vo_border)
673 AdjustWindowRect(&rdw,WNDSTYLE,FALSE); 674 AdjustWindowRect(&rdw,WNDSTYLE,FALSE);
674 // printf("window: %i %i %ix%i\n",rdw.left,rdw.top,rdw.right - rdw.left,rdw.bottom - rdw.top); 675 // printf("window: %i %i %ix%i\n",rdw.left,rdw.top,rdw.right - rdw.left,rdw.bottom - rdw.top);
675 rdw.left += monitor_rect.left; /* move to global coordinate space */ 676 rdw.left += monitor_rect.left; /* move to global coordinate space */
676 rdw.top += monitor_rect.top; 677 rdw.top += monitor_rect.top;
677 rdw.right += monitor_rect.left; 678 rdw.right += monitor_rect.left;
1037 wc.lpszMenuName = NULL; 1038 wc.lpszMenuName = NULL;
1038 RegisterClass(&wc); 1039 RegisterClass(&wc);
1039 if (WinID != -1) hWnd = WinID; 1040 if (WinID != -1) hWnd = WinID;
1040 else 1041 else
1041 hWnd = CreateWindowEx(vidmode?WS_EX_TOPMOST:0, 1042 hWnd = CreateWindowEx(vidmode?WS_EX_TOPMOST:0,
1042 WNDCLASSNAME_WINDOWED,"",(vidmode)?WS_POPUP:WNDSTYLE, 1043 WNDCLASSNAME_WINDOWED,"",(vidmode || !vo_border)?WS_POPUP:WNDSTYLE,
1043 CW_USEDEFAULT, CW_USEDEFAULT, 100, 100,NULL,NULL,hInstance,NULL); 1044 CW_USEDEFAULT, CW_USEDEFAULT, 100, 100,NULL,NULL,hInstance,NULL);
1044 wc.hbrBackground = blackbrush; 1045 wc.hbrBackground = blackbrush;
1045 wc.lpszClassName = WNDCLASSNAME_FULLSCREEN; 1046 wc.lpszClassName = WNDCLASSNAME_FULLSCREEN;
1046 RegisterClass(&wc); 1047 RegisterClass(&wc);
1047 1048
1293 rd.left = vo_dx; 1294 rd.left = vo_dx;
1294 rd.top = vo_dy; 1295 rd.top = vo_dy;
1295 rd.right = rd.left + d_image_width; 1296 rd.right = rd.left + d_image_width;
1296 rd.bottom = rd.top + d_image_height; 1297 rd.bottom = rd.top + d_image_height;
1297 if (WinID == -1) { 1298 if (WinID == -1) {
1299 if (vo_border)
1298 AdjustWindowRect(&rd,WNDSTYLE,FALSE); 1300 AdjustWindowRect(&rd,WNDSTYLE,FALSE);
1299 SetWindowPos(hWnd,NULL, vo_dx, vo_dy,rd.right-rd.left,rd.bottom-rd.top,SWP_SHOWWINDOW|SWP_NOOWNERZORDER); 1301 SetWindowPos(hWnd,NULL, vo_dx, vo_dy,rd.right-rd.left,rd.bottom-rd.top,SWP_SHOWWINDOW|SWP_NOOWNERZORDER);
1300 } 1302 }
1301 } 1303 }
1302 else ShowWindow(hWnd,SW_SHOW); 1304 else ShowWindow(hWnd,SW_SHOW);
1447 return get_image(data); 1449 return get_image(data);
1448 case VOCTRL_QUERY_FORMAT: 1450 case VOCTRL_QUERY_FORMAT:
1449 return query_format(*((uint32_t*)data)); 1451 return query_format(*((uint32_t*)data));
1450 case VOCTRL_DRAW_IMAGE: 1452 case VOCTRL_DRAW_IMAGE:
1451 return put_image(data); 1453 return put_image(data);
1454 case VOCTRL_BORDER:
1455 if(WinID != -1) return VO_TRUE;
1456 if(vidmode)
1457 {
1458 mp_msg(MSGT_VO, MSGL_ERR,"<vo_directx><ERROR>border has no meaning in exclusive mode\n");
1459 }
1460 else
1461 {
1462 if(vo_border) {
1463 vo_border = 0;
1464 SetWindowLong(hWnd, GWL_STYLE, WS_POPUP);
1465 } else {
1466 vo_border = 1;
1467 SetWindowLong(hWnd, GWL_STYLE, WNDSTYLE);
1468 }
1469 // needed AFAICT to force the window to
1470 // redisplay with the new style. --Joey
1471 if (!vo_fs) {
1472 ShowWindow(hWnd,SW_HIDE);
1473 ShowWindow(hWnd,SW_SHOW);
1474 }
1475 Directx_ManageDisplay();
1476 }
1477 return VO_TRUE;
1452 case VOCTRL_ONTOP: 1478 case VOCTRL_ONTOP:
1453 if(WinID != -1) return VO_TRUE; 1479 if(WinID != -1) return VO_TRUE;
1454 if(vidmode) 1480 if(vidmode)
1455 { 1481 {
1456 mp_msg(MSGT_VO, MSGL_ERR,"<vo_directx><ERROR>ontop has no meaning in exclusive mode\n"); 1482 mp_msg(MSGT_VO, MSGL_ERR,"<vo_directx><ERROR>ontop has no meaning in exclusive mode\n");