changeset 16282:273d33249c25

-wid support for windows. Not well tested, might still behave a bit weird.
author reimar
date Sun, 21 Aug 2005 09:59:45 +0000
parents dc50524c98dc
children 67dc03c037e7
files libvo/vo_gl.c libvo/vo_gl2.c libvo/w32_common.c
diffstat 3 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_gl.c	Sun Aug 21 08:40:26 2005 +0000
+++ b/libvo/vo_gl.c	Sun Aug 21 09:59:45 2005 +0000
@@ -79,13 +79,11 @@
 
 static void resize(int x,int y){
   mp_msg(MSGT_VO, MSGL_V, "[gl] Resize: %dx%d\n",x,y);
-#ifndef GL_WIN32
   if (WinID >= 0) {
     int top = 0, left = 0, w = x, h = y;
     geometry(&top, &left, &w, &h, vo_screenwidth, vo_screenheight);
     glViewport(top, left, w, h);
   } else
-#endif
   glViewport( 0, 0, x, y );
 
   glMatrixMode(GL_PROJECTION);
--- a/libvo/vo_gl2.c	Sun Aug 21 08:40:26 2005 +0000
+++ b/libvo/vo_gl2.c	Sun Aug 21 09:59:45 2005 +0000
@@ -504,13 +504,11 @@
 	  glViewport( (vo_screenwidth-*x)/2, (vo_screenheight-*y)/2, *x, *y);
   } else { 
 	  //aspect(x, y, A_NOZOOM);
-#ifndef GL_WIN32
 	if (WinID >= 0) {
 	  int top = 0, left = 0, w = *x, h = *y;
 	  geometry(&top, &left, &w, &h, vo_screenwidth, vo_screenheight);
 	  glViewport(top, left, w, h);
 	} else
-#endif
 	  glViewport( 0, 0, *x, *y );
   }
 
--- a/libvo/w32_common.c	Sun Aug 21 08:40:26 2005 +0000
+++ b/libvo/w32_common.c	Sun Aug 21 09:59:45 2005 +0000
@@ -225,11 +225,15 @@
     }
   }
 
+    if (WinID >= 0)
+      vo_window = WinID;
+    else {
     vo_window = CreateWindowEx(0, classname, classname, 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;
     }
+    }
 
     vo_hdc = GetDC(vo_window);
 
@@ -259,6 +263,7 @@
     resetMode();
     ShowCursor(1);
     vo_depthonscreen = 0;
+    if (WinID >= 0)
     DestroyWindow(vo_window);
     vo_window = 0;
     UnregisterClass(classname, 0);