summaryrefslogtreecommitdiffstats
path: root/libvo/gl_common.c
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-04-25 08:17:23 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-04-25 08:17:23 +0000
commit7c2bef4bb5a3275dc2e3fb75dfeb03ac1f1b5755 (patch)
treedea919127f2f4ee922b845fcea315ff80cdce8a1 /libvo/gl_common.c
parent5cdca550058a667f8f5aa643dc0ef9f1099605db (diff)
downloadmpv-7c2bef4bb5a3275dc2e3fb75dfeb03ac1f1b5755.tar.bz2
mpv-7c2bef4bb5a3275dc2e3fb75dfeb03ac1f1b5755.tar.xz
Add sdl_common file and use it to share the input handling between -vo gl
with SDL backend and -vo sdl. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31074 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/gl_common.c')
-rw-r--r--libvo/gl_common.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/libvo/gl_common.c b/libvo/gl_common.c
index e21d40f9d2..2c4c001c00 100644
--- a/libvo/gl_common.c
+++ b/libvo/gl_common.c
@@ -1844,11 +1844,7 @@ 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
+#include "sdl_common.h"
static void swapGlBuffers_sdl(MPGLContext *ctx) {
SDL_GL_SwapBuffers();
@@ -1863,6 +1859,16 @@ static int setGlWindow_sdl(MPGLContext *ctx) {
getFunctions(sdlgpa, NULL);
return SET_WINDOW_OK;
}
+
+static int sdl_check_events(void) {
+ int res = 0;
+ SDL_Event event;
+ while (SDL_PollEvent(&event)) {
+ res |= sdl_default_handle_event(&event);
+ }
+ return res;
+}
+
#endif
static int setGlWindow_dummy(MPGLContext *ctx) {
@@ -1913,6 +1919,7 @@ int init_mpglcontext(MPGLContext *ctx, enum MPGLType type) {
SDL_Init(SDL_INIT_VIDEO);
ctx->setGlWindow = setGlWindow_sdl;
ctx->swapGlBuffers = swapGlBuffers_sdl;
+ ctx->check_events = sdl_check_events;
return 1;
#endif
default: