[MPlayer-cvslog] CVS: main/libvo gl_common.c, 1.35, 1.36 gl_common.h, 1.22, 1.23 vo_gl.c, 1.109, 1.110 vo_gl2.c, 1.83, 1.84

Reimar Döffinger CVS syncmail at mplayerhq.hu
Tue Dec 6 23:23:08 CET 2005


CVS change done by Reimar Döffinger CVS

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

Modified Files:
	gl_common.c gl_common.h vo_gl.c vo_gl2.c 
Log Message:
Get rid of most #ifdefs


Index: gl_common.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/gl_common.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- gl_common.c	19 Nov 2005 14:00:35 -0000	1.35
+++ gl_common.c	6 Dec 2005 22:23:06 -0000	1.36
@@ -949,6 +949,7 @@
 }
 
 #ifdef GL_WIN32
+#include "w32_common.h"
 /**
  * \brief little helper since wglGetProcAddress definition does not fit our 
  *        getProcAddress
@@ -1023,10 +1024,15 @@
   }
   *context = 0;
 }
+
+void swapGlBuffers() {
+  SwapBuffers(vo_hdc);
+}
 #else
 #ifdef HAVE_LIBDL
 #include <dlfcn.h>
 #endif
+#include "x11_common.h"
 /**
  * \brief find address of a linked function
  * \param s name of function to find
@@ -1159,5 +1165,9 @@
   }
   *context = 0;
 }
+
+void swapGlBuffers() {
+  glXSwapBuffers(mDisplay, vo_window);
+}
 #endif
 

Index: gl_common.h
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/gl_common.h,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- gl_common.h	31 Oct 2005 13:56:16 -0000	1.22
+++ gl_common.h	6 Dec 2005 22:23:06 -0000	1.23
@@ -231,12 +231,21 @@
 /** \} */
 
 #ifdef GL_WIN32
+#define vo_check_events() vo_w32_check_events()
+#define vo_fullscreen() vo_w32_fullscreen()
+#define vo_ontop() vo_w32_ontop()
+#define vo_uninit() vo_w32_uninit()
 int setGlWindow(int *vinfo, HGLRC *context, HWND win);
 void releaseGlContext(int *vinfo, HGLRC *context);
 #else
+#define vo_check_events() vo_x11_check_events(mDisplay)
+#define vo_fullscreen() vo_x11_fullscreen()
+#define vo_ontop() vo_x11_ontop()
+#define vo_uninit() vo_x11_uninit()
 int setGlWindow(XVisualInfo **vinfo, GLXContext *context, Window win);
 void releaseGlContext(XVisualInfo **vinfo, GLXContext *context);
 #endif
+void swapGlBuffers();
 
 extern void (APIENTRY *GenBuffers)(GLsizei, GLuint *);
 extern void (APIENTRY *DeleteBuffers)(GLsizei, const GLuint *);

Index: vo_gl.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_gl.c,v
retrieving revision 1.109
retrieving revision 1.110
diff -u -r1.109 -r1.110
--- vo_gl.c	22 Nov 2005 16:18:34 -0000	1.109
+++ vo_gl.c	6 Dec 2005 22:23:06 -0000	1.110
@@ -312,11 +312,6 @@
 	vo_dy = (vo_screenheight - d_height) / 2;
 	geometry(&vo_dx, &vo_dy, &d_width, &d_height,
 	          vo_screenwidth, vo_screenheight);
-#ifdef X11_FULLSCREEN
-//        if( flags&VOFLAG_FULLSCREEN ){ // (-fs)
-//          aspect(&d_width,&d_height,A_ZOOM);
-//        }
-#endif
 #ifdef HAVE_NEW_GUI
   if (use_gui) {
     // GUI creates and manages window for us
@@ -379,7 +374,6 @@
       vo_x11_classhint( mDisplay,vo_window,"gl" );
       vo_hidecursor(mDisplay,vo_window);
 
-//      if ( flags&VOFLAG_FULLSCREEN ) vo_x11_decoration( mDisplay,vo_window,0 );
 	  XSelectInput(mDisplay, vo_window, StructureNotifyMask);
 	  /* Tell other applications about this window */
 	  XSetStandardProperties(mDisplay, vo_window, title, title, None, NULL, 0, &hint);
@@ -422,11 +416,7 @@
 
 static void check_events(void)
 {
-#ifdef GL_WIN32
-    int e=vo_w32_check_events();
-#else
-    int e=vo_x11_check_events(mDisplay);
-#endif
+    int e=vo_check_events();
     if(e&VO_EVENT_RESIZE) resize(vo_dwidth,vo_dheight);
     if(e&VO_EVENT_EXPOSE && int_pause) flip_page();
 }
@@ -544,11 +534,7 @@
   if (use_glFinish)
   glFinish();
   if (vo_doublebuffering)
-#ifdef GL_WIN32
-  SwapBuffers(vo_hdc);
-#else
-  glXSwapBuffers( mDisplay,vo_window );
-#endif
+    swapGlBuffers();
  
   if (vo_fs && use_aspect && vo_doublebuffering)
     glClear(GL_COLOR_BUFFER_BIT);
@@ -677,11 +663,7 @@
   custom_prog = NULL;
   if (custom_tex) free(custom_tex);
   custom_tex = NULL;
-#ifdef GL_WIN32
-  vo_w32_uninit();
-#else
-  vo_x11_uninit();
-#endif
+  vo_uninit();
 }
 
 static opt_t subopts[] = {
@@ -784,19 +766,11 @@
   case VOCTRL_GUISUPPORT:
     return VO_TRUE;
   case VOCTRL_ONTOP:
-#ifdef GL_WIN32
-    vo_w32_ontop();
-#else
-    vo_x11_ontop();
-#endif
+    vo_ontop();
     return VO_TRUE;
   case VOCTRL_FULLSCREEN:
-#ifdef GL_WIN32
-    vo_w32_fullscreen();
+    vo_fullscreen();
     resize(vo_dwidth, vo_dheight);
-#else
-    vo_x11_fullscreen();
-#endif
     return VO_TRUE;
 #ifdef GL_WIN32
   case VOCTRL_BORDER:

Index: vo_gl2.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_gl2.c,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -r1.83 -r1.84
--- vo_gl2.c	17 Nov 2005 20:49:46 -0000	1.83
+++ vo_gl2.c	6 Dec 2005 22:23:06 -0000	1.84
@@ -905,24 +905,15 @@
 	return 1;
 }
 
-#ifdef GL_WIN32
-
-static void check_events(void) {
-    int e=vo_w32_check_events();
-    if(e&VO_EVENT_RESIZE) resize(&vo_dwidth, &vo_dheight);
-    if(e&VO_EVENT_EXPOSE && int_pause) flip_page();
-}
-
-#else
-
 static void check_events(void)
 {
+	 int e;
+#ifndef GL_WIN32
 	 XEvent         Event;
 	 char           buf[100];
 	 KeySym         keySym;
 	 int            key;
 	 static XComposeStatus stat;
-	 int e;
          
 	 while ( XPending( mDisplay ) )
 	 {
@@ -941,13 +932,12 @@
 	               break;
 	      }
          }
-	 e=vo_x11_check_events(mDisplay);
+#endif
+	 e=vo_check_events();
          if(e&VO_EVENT_RESIZE) resize(&vo_dwidth, &vo_dheight);
          if(e&VO_EVENT_EXPOSE && int_pause) flip_page();
 }
 
-#endif
-
 static void draw_osd(void)
 {
   if (ImageData)
@@ -963,11 +953,7 @@
 //  glFlush();
   if (use_glFinish)
   glFinish();
-#ifdef GL_WIN32
-  SwapBuffers(vo_hdc);
-#else
-  glXSwapBuffers( mDisplay,vo_window );
-#endif
+  swapGlBuffers();
 
   if (vo_fs) // Avoid flickering borders in fullscreen mode
     glClear (GL_COLOR_BUFFER_BIT);
@@ -1070,11 +1056,7 @@
     free(texgrid);
     texgrid = NULL;
   }
-#ifdef GL_WIN32
-  vo_w32_uninit();
-#else
-  vo_x11_uninit();
-#endif
+  vo_uninit();
 }
 
 static opt_t subopts[] = {
@@ -1119,18 +1101,10 @@
   case VOCTRL_GUISUPPORT:
         return VO_TRUE;
   case VOCTRL_ONTOP:
-#ifdef GL_WIN32
-    vo_w32_ontop();
-#else
-    vo_x11_ontop();
-#endif 
+    vo_ontop();
     return VO_TRUE;
   case VOCTRL_FULLSCREEN:
-#ifdef GL_WIN32
-    vo_w32_fullscreen();
-#else
-    vo_x11_fullscreen();
-#endif 
+    vo_fullscreen();
     if (setGlWindow(&gl_vinfo, &gl_context, vo_window) == SET_WINDOW_REINIT)
       initGl(vo_dwidth, vo_dheight);
     resize(&vo_dwidth, &vo_dheight);




More information about the MPlayer-cvslog mailing list