summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-04-24 16:46:47 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-04-24 16:46:47 +0000
commit6e4458ffa394553b8d5e21f6b3a536d5be48b787 (patch)
tree20b86dbb2440ecb603718c4ca02aaffdbb2b9262 /libvo
parent976d35bc6b7f677956bd4f227326a834622ab1eb (diff)
downloadmpv-6e4458ffa394553b8d5e21f6b3a536d5be48b787.tar.bz2
mpv-6e4458ffa394553b8d5e21f6b3a536d5be48b787.tar.xz
First steps to support -vo gl with SDL-based Window handling.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31062 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/gl_common.c39
-rw-r--r--libvo/gl_common.h1
2 files changed, 40 insertions, 0 deletions
diff --git a/libvo/gl_common.c b/libvo/gl_common.c
index e8b66e1ccc..91281a3c00 100644
--- a/libvo/gl_common.c
+++ b/libvo/gl_common.c
@@ -1842,8 +1842,36 @@ static int x11_check_events(void) {
}
#endif
+#ifdef CONFIG_GL_SDL
+#ifdef CONFIG_SDL_SDL_H
+#include <SDL/SDL.h>
+#else
+#include <SDL.h>
+#endif
+
+static void swapGlBuffers_sdl(MPGLContext *ctx) {
+ SDL_GL_SwapBuffers();
+}
+
+#endif
+
+static int setGlWindow_dummy(MPGLContext *ctx) {
+ getFunctions(setNull, NULL);
+ return SET_WINDOW_OK;
+}
+
+static void releaseGlContext_dummy(MPGLContext *ctx) {
+}
+
+static int dummy_check_events(void) {
+ return 0;
+}
+
int init_mpglcontext(MPGLContext *ctx, enum MPGLType type) {
memset(ctx, 0, sizeof(*ctx));
+ ctx->setGlWindow = setGlWindow_dummy;
+ ctx->releaseGlContext = releaseGlContext_dummy;
+ ctx->check_events = dummy_check_events;
ctx->type = type;
switch (ctx->type) {
#ifdef CONFIG_GL_WIN32
@@ -1870,6 +1898,12 @@ int init_mpglcontext(MPGLContext *ctx, enum MPGLType type) {
ctx->ontop = vo_x11_ontop;
return vo_init();
#endif
+#ifdef CONFIG_GL_SDL
+ case GLTYPE_SDL:
+ SDL_Init(SDL_INIT_VIDEO);
+ ctx->swapGlBuffers = swapGlBuffers_sdl;
+ return 1;
+#endif
default:
return 0;
}
@@ -1888,6 +1922,11 @@ void uninit_mpglcontext(MPGLContext *ctx) {
vo_x11_uninit();
break;
#endif
+#ifdef CONFIG_GL_SDL
+ case GLTYPE_SDL:
+ SDL_QuitSubSystem(SDL_INIT_VIDEO);
+ break;
+#endif
}
memset(ctx, 0, sizeof(*ctx));
}
diff --git a/libvo/gl_common.h b/libvo/gl_common.h
index ef38f58808..f6f6a4f234 100644
--- a/libvo/gl_common.h
+++ b/libvo/gl_common.h
@@ -372,6 +372,7 @@ void glDisableYUVConversion(GLenum target, int type);
enum MPGLType {
GLTYPE_W32,
GLTYPE_X11,
+ GLTYPE_SDL,
};
typedef struct MPGLContext {