summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-12-19 10:52:32 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-12-19 10:52:32 +0000
commit140de2a9e2a7a057ff58254eb3d0eafe0754ae24 (patch)
tree01d9133bbabc853a716fcf1a26c7c81d5b5b98cd
parentcb7a098c81c2cd2191faa452d9f025da7a22e1bc (diff)
downloadmpv-140de2a9e2a7a057ff58254eb3d0eafe0754ae24.tar.bz2
mpv-140de2a9e2a7a057ff58254eb3d0eafe0754ae24.tar.xz
Make the check for X11 and WIN32 backends for OpenGL separate.
This fixes compilation on Windows with X11 but no GLX available. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30063 b3059339-0415-0410-9bf9-f77b7e298cf2
-rwxr-xr-xconfigure15
-rw-r--r--libvo/gl_common.c6
-rw-r--r--libvo/gl_common.h6
-rw-r--r--libvo/vo_gl.c8
-rw-r--r--libvo/vo_gl2.c2
5 files changed, 24 insertions, 13 deletions
diff --git a/configure b/configure
index 16049ced48..56cc8095ea 100755
--- a/configure
+++ b/configure
@@ -4922,11 +4922,14 @@ EOF
_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 @@ else
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 @@ GIF = $_gif
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_4
$def_gif_tvt_hack
$def_gl
$def_gl_win32
+$def_gl_x11
$def_ivtv
$def_jpeg
$def_kva
diff --git a/libvo/gl_common.c b/libvo/gl_common.c
index efd569dc5c..c35a531bd3 100644
--- a/libvo/gl_common.c
+++ b/libvo/gl_common.c
@@ -1634,7 +1634,7 @@ static void swapGlBuffers_w32(MPGLContext *ctx) {
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 @@ int init_mpglcontext(MPGLContext *ctx, enum MPGLType type) {
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 @@ void uninit_mpglcontext(MPGLContext *ctx) {
vo_w32_uninit();
break;
#endif
-#ifdef CONFIG_X11
+#ifdef GL_X11
case GLTYPE_X11:
vo_x11_uninit();
break;
diff --git a/libvo/gl_common.h b/libvo/gl_common.h
index dc2fe6698f..f149589878 100644
--- a/libvo/gl_common.h
+++ b/libvo/gl_common.h
@@ -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 @@ typedef struct MPGLContext {
enum MPGLType type;
union {
int w32;
-#ifdef CONFIG_X11
+#ifdef GL_X11
XVisualInfo *x11;
#endif
} vinfo;
@@ -370,7 +370,7 @@ typedef struct MPGLContext {
#ifdef GL_WIN32
HGLRC w32;
#endif
-#ifdef CONFIG_X11
+#ifdef GL_X11
GLXContext x11;
#endif
} context;
diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c
index ccb44e1882..cc1c9bcca5 100644
--- a/libvo/vo_gl.c
+++ b/libvo/vo_gl.c
@@ -48,7 +48,7 @@ static const vo_info_t info =
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 @@ static void uninitGl(void) {
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 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin
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 @@ static uint32_t get_image(mp_image_t *mpi) {
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;
diff --git a/libvo/vo_gl2.c b/libvo/vo_gl2.c
index 197f7cd1b1..dd41e6a4ab 100644
--- a/libvo/vo_gl2.c
+++ b/libvo/vo_gl2.c
@@ -125,7 +125,7 @@ static GLint getInternalFormat(void)
}
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;