[MPlayer-cvslog] CVS: main/libvo gl_common.c, 1.7, 1.8 gl_common.h, 1.6, 1.7 vo_gl.c, 1.75, 1.76 w32_common.c, 1.10, 1.11 w32_common.h, 1.3, 1.4

Reimar Döffinger CVS syncmail at mplayerhq.hu
Tue Jul 26 15:47:21 CEST 2005


CVS change done by Reimar Döffinger CVS

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

Modified Files:
	gl_common.c gl_common.h vo_gl.c w32_common.c w32_common.h 
Log Message:
OpenGL fixes for windows and vo_gl.c ported to windows.


Index: gl_common.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/gl_common.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- gl_common.c	26 Jul 2005 10:16:18 -0000	1.7
+++ gl_common.c	26 Jul 2005 13:47:18 -0000	1.8
@@ -3,7 +3,7 @@
 void (APIENTRY *BindBuffer)(GLenum, GLuint);
 GLvoid* (APIENTRY *MapBuffer)(GLenum, GLenum); 
 GLboolean (APIENTRY *UnmapBuffer)(GLenum);
-void (APIENTRY *BufferData)(GLenum, GLsizeiptr, const GLvoid *, GLenum);
+void (APIENTRY *BufferData)(GLenum, intptr_t, const GLvoid *, GLenum);
 void (APIENTRY *CombinerParameterfv)(GLenum, const GLfloat *);
 void (APIENTRY *CombinerParameteri)(GLenum, GLint);
 void (APIENTRY *CombinerInput)(GLenum, GLenum, GLenum, GLenum, GLenum,
@@ -257,6 +257,10 @@
 }
 
 #ifdef GL_WIN32
+static void *w32gpa(const GLubyte *procName) {
+  return wglGetProcAddress(procName);
+}
+
 int setGlWindow(int *vinfo, HGLRC *context, HWND win)
 {
   int new_vinfo;
@@ -304,7 +308,7 @@
       wglDeleteContext(*context);
     *context = new_context;
     *vinfo = new_vinfo;
-    getProcAddress = wglGetProcAddress;
+    getProcAddress = w32gpa;
     getFunctions();
 
     // and inform that reinit is neccessary

Index: gl_common.h
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/gl_common.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- gl_common.h	26 Jul 2005 10:16:18 -0000	1.6
+++ gl_common.h	26 Jul 2005 13:47:18 -0000	1.7
@@ -55,7 +55,7 @@
 extern void (APIENTRY *BindBuffer)(GLenum, GLuint);
 extern GLvoid* (APIENTRY *MapBuffer)(GLenum, GLenum); 
 extern GLboolean (APIENTRY *UnmapBuffer)(GLenum);
-extern void (APIENTRY *BufferData)(GLenum, GLsizeiptr, const GLvoid *, GLenum);
+extern void (APIENTRY *BufferData)(GLenum, intptr_t, const GLvoid *, GLenum);
 extern void (APIENTRY *CombinerParameterfv)(GLenum, const GLfloat *);
 extern void (APIENTRY *CombinerParameteri)(GLenum, GLint);
 extern void (APIENTRY *CombinerInput)(GLenum, GLenum, GLenum, GLenum, GLenum,

Index: vo_gl.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_gl.c,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -r1.75 -r1.76
--- vo_gl.c	26 Jul 2005 10:16:18 -0000	1.75
+++ vo_gl.c	26 Jul 2005 13:47:18 -0000	1.76
@@ -30,6 +30,10 @@
 
 LIBVO_EXTERN(gl)
 
+#ifdef GL_WIN32
+static int gl_vinfo = 0;
+static HGLRC gl_context = 0;
+#else
 static XVisualInfo *gl_vinfo = NULL;
 static GLXContext gl_context = 0;
 static int                  wsGLXAttrib[] = { GLX_RGBA,
@@ -38,6 +42,7 @@
                                        GLX_BLUE_SIZE,1,
                                        GLX_DOUBLEBUFFER,
                                        None };
+#endif
 
 static int use_osd;
 static int scaled_osd;
@@ -76,11 +81,13 @@
 
 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);
@@ -198,6 +205,16 @@
     goto glconfig;
   }
 #endif
+#ifdef GL_WIN32
+  o_dwidth = d_width;
+  o_dheight = d_height;
+  vo_fs = flags & VOFLAG_FULLSCREEN;
+  vo_vm = flags & VOFLAG_MODESWITCHING;
+  vo_dwidth = d_width;
+  vo_dheight = d_height;
+  if (!createRenderingContext())
+    return -1;
+#else
   if (WinID >= 0) {
     Window win_tmp;
     int int_tmp;
@@ -270,6 +287,7 @@
   vo_x11_nofs_sizepos(vo_dx, vo_dy, d_width, d_height);
   if (vo_fs ^ (flags & VOFLAG_FULLSCREEN))
     vo_x11_fullscreen();
+#endif
 
 glconfig:
   setGlWindow(&gl_vinfo, &gl_context, vo_window);
@@ -280,7 +298,11 @@
 
 static void check_events(void)
 {
+#ifdef GL_WIN32
+    int e=vo_w32_check_events();
+#else
     int e=vo_x11_check_events(mDisplay);
+#endif
     if(e&VO_EVENT_RESIZE) resize(vo_dwidth,vo_dheight);
     if(e&VO_EVENT_EXPOSE && int_pause) flip_page();
 }
@@ -442,7 +464,11 @@
 
 //  glFlush();
   glFinish();
+#ifdef GL_WIN32
+  SwapBuffers(vo_hdc);
+#else
   glXSwapBuffers( mDisplay,vo_window );
+#endif
  
   if (vo_fs && use_aspect)
     glClear(GL_COLOR_BUFFER_BIT);
@@ -535,7 +561,11 @@
 {
   if ( !vo_config_count ) return;
   releaseGlContext(&gl_vinfo, &gl_context);
+#ifdef GL_WIN32
+  vo_w32_uninit();
+#else
   vo_x11_uninit();
+#endif
 }
 
 static opt_t subopts[] = {
@@ -606,10 +636,19 @@
   case VOCTRL_GUISUPPORT:
     return VO_TRUE;
   case VOCTRL_ONTOP:
+#ifdef GL_WIN32
+    vo_w32_ontop();
+#else
     vo_x11_ontop();
+#endif
     return VO_TRUE;
   case VOCTRL_FULLSCREEN:
+#ifdef GL_WIN32
+    vo_w32_fullscreen();
+    resize(vo_dwidth, vo_dheight);
+#else
     vo_x11_fullscreen();
+#endif
     return VO_TRUE;
   case VOCTRL_GET_PANSCAN:
     if (!use_aspect) return VO_NOTIMPL;

Index: w32_common.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/w32_common.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- w32_common.c	30 May 2005 08:45:21 -0000	1.10
+++ w32_common.c	26 Jul 2005 13:47:18 -0000	1.11
@@ -180,7 +180,7 @@
     updateScreenProperties();
     vo_dwidth = vo_fs ? vo_screenwidth : o_dwidth;
     vo_dheight = vo_fs ? vo_screenheight : o_dheight;
-    SetWindowPos(vo_window, layer, vo_dx, vo_dy, vo_dwidth, vo_dheight, SWP_SHOWWINDOW);
+    SetWindowPos(vo_window, layer, vo_fs ? 0 : vo_dx, vo_fs ? 0 : vo_dy, vo_dwidth, vo_dheight, SWP_SHOWWINDOW);
 
     PIXELFORMATDESCRIPTOR pfd;
     memset(&pfd, 0, sizeof pfd);

Index: w32_common.h
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/w32_common.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- w32_common.h	11 Dec 2004 16:57:42 -0000	1.3
+++ w32_common.h	26 Jul 2005 13:47:18 -0000	1.4
@@ -11,6 +11,7 @@
 
 extern int vo_init(void);
 extern void vo_w32_uninit(void);
+extern void vo_w32_ontop(void);
 extern void vo_w32_fullscreen(void);
 extern int vo_w32_check_events(void);
 extern int createRenderingContext(void);




More information about the MPlayer-cvslog mailing list