Mercurial > mplayer.hg
changeset 31020:529614f44431
First steps to support -vo gl with SDL-based Window handling.
author | reimar |
---|---|
date | Sat, 24 Apr 2010 16:46:47 +0000 |
parents | d50e094bfd13 |
children | b25ae678c778 |
files | libvo/gl_common.c libvo/gl_common.h |
diffstat | 2 files changed, 40 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/libvo/gl_common.c Sat Apr 24 10:50:21 2010 +0000 +++ b/libvo/gl_common.c Sat Apr 24 16:46:47 2010 +0000 @@ -1842,8 +1842,36 @@ } #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 @@ 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 @@ vo_x11_uninit(); break; #endif +#ifdef CONFIG_GL_SDL + case GLTYPE_SDL: + SDL_QuitSubSystem(SDL_INIT_VIDEO); + break; +#endif } memset(ctx, 0, sizeof(*ctx)); }