changeset 30021:7f09bc7a4279

Make the check for X11 and WIN32 backends for OpenGL separate. This fixes compilation on Windows with X11 but no GLX available.
author reimar
date Sat, 19 Dec 2009 10:52:32 +0000
parents d652e17184f9
children d6a9eeff0125
files configure libvo/gl_common.c libvo/gl_common.h libvo/vo_gl.c libvo/vo_gl2.c
diffstat 5 files changed, 24 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/configure	Fri Dec 18 20:27:35 2009 +0000
+++ b/configure	Sat Dec 19 10:52:32 2009 +0000
@@ -4922,11 +4922,14 @@
   _gl=no
   if cc_check -lGL $_ld_lm ; then
     _gl=yes
+    _gl_x11=yes
     libs_mplayer="$libs_mplayer -lGL $_ld_dl"
   elif cc_check -lGL $_ld_lm $_ld_pthread ; then
     _gl=yes
+    _gl_x11=yes
     libs_mplayer="$libs_mplayer -lGL $_ld_pthread $_ld_dl"
-  elif cc_check -DGL_WIN32 -lopengl32 ; then
+  fi
+  if cc_check -DGL_WIN32 -lopengl32 ; then
     _gl=yes
     _gl_win32=yes
     libs_mplayer="$libs_mplayer -lopengl32 -lgdi32"
@@ -4936,14 +4939,20 @@
 fi
 if test "$_gl" = yes ; then
   def_gl='#define CONFIG_GL 1'
+  _res_comment="backends:"
   if test "$_gl_win32" = yes ; then
     def_gl_win32='#define GL_WIN32 1'
-    _res_comment="win32 version"
+    _res_comment="$_res_comment win32"
+  fi
+  if test "$_gl_x11" = yes ; then
+    def_gl_x11='#define GL_X11 1'
+    _res_comment="$_res_comment x11"
   fi
   _vomodules="opengl $_vomodules"
 else
   def_gl='#undef CONFIG_GL'
   def_gl_win32='#undef GL_WIN32'
+  def_gl_x11='#undef GL_X11'
   _novomodules="opengl $_novomodules"
 fi
 echores "$_gl"
@@ -8280,6 +8289,7 @@
 GGI = $_ggi
 GL = $_gl
 GL_WIN32 = $_gl_win32
+GL_X11 = $_gl_x11
 GUI = $_gui
 GUI_GTK = $_gui_gtk
 GUI_WIN32 = $_gui_win32
@@ -8802,6 +8812,7 @@
 $def_gif_tvt_hack
 $def_gl
 $def_gl_win32
+$def_gl_x11
 $def_ivtv
 $def_jpeg
 $def_kva
--- a/libvo/gl_common.c	Fri Dec 18 20:27:35 2009 +0000
+++ b/libvo/gl_common.c	Sat Dec 19 10:52:32 2009 +0000
@@ -1634,7 +1634,7 @@
   vo_w32_release_dc(vo_w32_window, vo_hdc);
 }
 #endif
-#ifdef CONFIG_X11
+#ifdef GL_X11
 #ifdef HAVE_LIBDL
 #include <dlfcn.h>
 #endif
@@ -1819,7 +1819,7 @@
     ctx->ontop = vo_w32_ontop;
     return vo_w32_init();
 #endif
-#ifdef CONFIG_X11
+#ifdef GL_X11
   case GLTYPE_X11:
     ctx->setGlWindow = setGlWindow_x11;
     ctx->releaseGlContext = releaseGlContext_x11;
@@ -1844,7 +1844,7 @@
     vo_w32_uninit();
     break;
 #endif
-#ifdef CONFIG_X11
+#ifdef GL_X11
   case GLTYPE_X11:
     vo_x11_uninit();
     break;
--- a/libvo/gl_common.h	Fri Dec 18 20:27:35 2009 +0000
+++ b/libvo/gl_common.h	Sat Dec 19 10:52:32 2009 +0000
@@ -32,7 +32,7 @@
 #include <GL/gl.h>
 #include "w32_common.h"
 #endif
-#ifdef CONFIG_X11
+#ifdef GL_X11
 #include <GL/gl.h>
 #include <X11/Xlib.h>
 #include <GL/glx.h>
@@ -362,7 +362,7 @@
   enum MPGLType type;
   union {
     int w32;
-#ifdef CONFIG_X11
+#ifdef GL_X11
     XVisualInfo *x11;
 #endif
   } vinfo;
@@ -370,7 +370,7 @@
 #ifdef GL_WIN32
     HGLRC w32;
 #endif
-#ifdef CONFIG_X11
+#ifdef GL_X11
     GLXContext x11;
 #endif
   } context;
--- a/libvo/vo_gl.c	Fri Dec 18 20:27:35 2009 +0000
+++ b/libvo/vo_gl.c	Sat Dec 19 10:52:32 2009 +0000
@@ -48,7 +48,7 @@
 
 const LIBVO_EXTERN(gl)
 
-#ifdef CONFIG_X11
+#ifdef GL_X11
 static int                  wsGLXAttrib[] = { GLX_RGBA,
                                        GLX_RED_SIZE,1,
                                        GLX_GREEN_SIZE,1,
@@ -428,7 +428,7 @@
     DeleteBuffers(2, gl_buffer_uv);
   gl_buffer_uv[0] = gl_buffer_uv[1] = 0; gl_buffersize_uv = 0;
   gl_bufferptr_uv[0] = gl_bufferptr_uv[1] = 0;
-#ifdef CONFIG_X11
+#ifdef GL_X11
   if (mesa_bufferptr)
     FreeMemoryMESA(mDisplay, mScreen, mesa_bufferptr);
 #endif
@@ -545,7 +545,7 @@
   if (glctx.type == GLTYPE_W32 && !vo_w32_config(d_width, d_height, flags))
     return -1;
 #endif
-#ifdef CONFIG_X11
+#ifdef GL_X11
   if (glctx.type == GLTYPE_X11) {
     XVisualInfo *vinfo=glXChooseVisual( mDisplay,mScreen,wsGLXAttrib );
     if (vinfo == NULL)
@@ -774,7 +774,7 @@
   mpi->stride[0] = mpi->width * mpi->bpp / 8;
   needed_size = mpi->stride[0] * mpi->height;
   if (mesa_buffer) {
-#ifdef CONFIG_X11
+#ifdef GL_X11
     if (mesa_bufferptr && needed_size > mesa_buffersize) {
       FreeMemoryMESA(mDisplay, mScreen, mesa_bufferptr);
       mesa_bufferptr = NULL;
--- a/libvo/vo_gl2.c	Fri Dec 18 20:27:35 2009 +0000
+++ b/libvo/vo_gl2.c	Sat Dec 19 10:52:32 2009 +0000
@@ -125,7 +125,7 @@
   }
   break;
 #endif
-#ifdef CONFIG_X11
+#ifdef GL_X11
   case GLTYPE_X11:
   if (glXGetConfig(mDisplay, glctx.vinfo.x11, GLX_RED_SIZE, &r_sz) != 0) r_sz = 0;
   if (glXGetConfig(mDisplay, glctx.vinfo.x11, GLX_GREEN_SIZE, &g_sz) != 0) g_sz = 0;