[MPlayer-cvslog] CVS: main/libvo vo_gl.c, 1.107, 1.108 vo_gl2.c, 1.82, 1.83 w32_common.c, 1.16, 1.17

Reimar Döffinger CVS syncmail at mplayerhq.hu
Thu Nov 17 21:49:48 CET 2005


CVS change done by Reimar Döffinger CVS

Update of /cvsroot/mplayer/main/libvo
In directory mail:/var2/tmp/cvs-serv29397

Modified Files:
	vo_gl.c vo_gl2.c w32_common.c 
Log Message:
Enable border toggling for gl and gl2 under windows.


Index: vo_gl.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_gl.c,v
retrieving revision 1.107
retrieving revision 1.108
diff -u -r1.107 -r1.108
--- vo_gl.c	31 Oct 2005 13:57:37 -0000	1.107
+++ vo_gl.c	17 Nov 2005 20:49:45 -0000	1.108
@@ -796,6 +796,11 @@
     vo_x11_fullscreen();
 #endif
     return VO_TRUE;
+#ifdef GL_WIN32
+  case VOCTRL_BORDER:
+    vo_w32_border();
+    return VO_TRUE;
+#endif
   case VOCTRL_GET_PANSCAN:
     if (!use_aspect) return VO_NOTIMPL;
     return VO_TRUE;

Index: vo_gl2.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_gl2.c,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -r1.82 -r1.83
--- vo_gl2.c	1 Oct 2005 12:53:49 -0000	1.82
+++ vo_gl2.c	17 Nov 2005 20:49:46 -0000	1.83
@@ -1135,6 +1135,11 @@
       initGl(vo_dwidth, vo_dheight);
     resize(&vo_dwidth, &vo_dheight);
     return VO_TRUE;
+#ifdef GL_WIN32
+  case VOCTRL_BORDER:
+    vo_w32_border();
+    return VO_TRUE;
+#endif
   case VOCTRL_GET_PANSCAN:
     return VO_TRUE;
   case VOCTRL_SET_PANSCAN:

Index: w32_common.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/w32_common.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- w32_common.c	2 Nov 2005 21:50:55 -0000	1.16
+++ w32_common.c	17 Nov 2005 20:49:46 -0000	1.17
@@ -161,7 +161,10 @@
 int createRenderingContext(void) {
     HWND layer = HWND_NOTOPMOST;
     PIXELFORMATDESCRIPTOR pfd;
+    RECT r;
     int pf;
+    int style = (vo_border && !vo_fs) ?
+                (WS_OVERLAPPEDWINDOW | WS_SIZEBOX) : WS_POPUP;
 
     if (vo_fs || vo_ontop) layer = HWND_TOPMOST;
     if (vo_fs) {
@@ -178,9 +181,16 @@
 	}
     }
     updateScreenProperties();
+    ShowWindow(vo_window, SW_HIDE);
+    SetWindowLong(vo_window, GWL_STYLE, style);
     vo_dwidth = vo_fs ? vo_screenwidth : o_dwidth;
     vo_dheight = vo_fs ? vo_screenheight : o_dheight;
-    SetWindowPos(vo_window, layer, vo_fs ? 0 : vo_dx, vo_fs ? 0 : vo_dy, vo_dwidth, vo_dheight, SWP_SHOWWINDOW);
+    r.left = vo_fs ? 0 : vo_dy;
+    r.right = r.left + vo_dwidth;
+    r.top = vo_fs ? 0 : vo_dx;
+    r.bottom = r.top + vo_dheight;
+    AdjustWindowRect(&r, style, 0);
+    SetWindowPos(vo_window, layer, r.left, r.top, r.right - r.left, r.bottom - r.top, SWP_SHOWWINDOW);
 
     memset(&pfd, 0, sizeof pfd);
     pfd.nSize = sizeof pfd;
@@ -228,7 +238,9 @@
     if (WinID >= 0)
       vo_window = WinID;
     else {
-    vo_window = CreateWindowEx(0, classname, classname, WS_POPUP, CW_USEDEFAULT, 0, 100, 100, 0, 0, hInstance, 0);
+    vo_window = CreateWindowEx(0, classname, classname,
+                  vo_border ? (WS_OVERLAPPEDWINDOW | WS_SIZEBOX) : WS_POPUP,
+                  CW_USEDEFAULT, 0, 100, 100, 0, 0, hInstance, 0);
     if (!vo_window) {
 	mp_msg(MSGT_VO, MSGL_ERR, "vo: win32: unable to create window!\n");
 	return 0;
@@ -248,6 +260,11 @@
     createRenderingContext();
 }
 
+void vo_w32_border() {
+    vo_border = !vo_border;
+    createRenderingContext();
+}
+
 void vo_w32_ontop( void )
 {
     vo_ontop = !vo_ontop;




More information about the MPlayer-cvslog mailing list