summaryrefslogtreecommitdiffstats
path: root/libvo/gl_common.h
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-12-08 06:42:46 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-12-08 06:42:46 +0000
commit2661039adac72207ee510fc98927a7cdac018254 (patch)
tree0bfe05e4390ec388b34e85fd27dadd80a7a756a4 /libvo/gl_common.h
parent1057181fd7ef1684ddaefbb081b9e90cb6eee348 (diff)
downloadmpv-2661039adac72207ee510fc98927a7cdac018254.tar.bz2
mpv-2661039adac72207ee510fc98927a7cdac018254.tar.xz
Very preliminary code to allow selecting the OpenGL backend at runtime.
Works in the currently supported cases for only Win32 and only X11, the mixed case is not working yet though. But applied anyway since the code is slightly less messy than the current one. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29980 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/gl_common.h')
-rw-r--r--libvo/gl_common.h52
1 files changed, 34 insertions, 18 deletions
diff --git a/libvo/gl_common.h b/libvo/gl_common.h
index 8f9ce55dab..53805f1299 100644
--- a/libvo/gl_common.h
+++ b/libvo/gl_common.h
@@ -31,7 +31,8 @@
#include <windows.h>
#include <GL/gl.h>
#include "w32_common.h"
-#else
+#endif
+#ifdef CONFIG_X11
#include <GL/gl.h>
#include <X11/Xlib.h>
#include <GL/glx.h>
@@ -352,24 +353,39 @@ void glDisableYUVConversion(GLenum target, int type);
#define SET_WINDOW_REINIT 1
/** \} */
+enum MPGLType {
+ GLTYPE_W32,
+ GLTYPE_X11,
+};
+
+typedef struct MPGLContext {
+ enum MPGLType type;
+ union {
+ int w32;
+#ifdef CONFIG_X11
+ XVisualInfo *x11;
+#endif
+ } vinfo;
+ union {
#ifdef GL_WIN32
-#define vo_border() vo_w32_border()
-#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_border() vo_x11_border()
-#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(void);
+ HGLRC w32;
+#endif
+#ifdef CONFIG_X11
+ GLXContext x11;
+#endif
+ } context;
+ int (*setGlWindow)(struct MPGLContext *);
+ void (*releaseGlContext)(struct MPGLContext *);
+ void (*swapGlBuffers)(struct MPGLContext *);
+ void (*update_xinerama_info)(void);
+ void (*border)(void);
+ int (*check_events)(void);
+ void (*fullscreen)(void);
+ void (*ontop)(void);
+} MPGLContext;
+
+int init_mpglcontext(MPGLContext *ctx, enum MPGLType type);
+void uninit_mpglcontext(MPGLContext *ctx);
extern void (APIENTRY *GenBuffers)(GLsizei, GLuint *);
extern void (APIENTRY *DeleteBuffers)(GLsizei, const GLuint *);