diff options
author | arpi_esp <arpi_esp@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-03-03 21:46:39 +0000 |
---|---|---|
committer | arpi_esp <arpi_esp@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-03-03 21:46:39 +0000 |
commit | 0661c59b20c2f75b2468ed95001ecf869a02eba4 (patch) | |
tree | 3653570fb3dcdb74421513cae97db5e25eddc092 /libvo/vo_gl.c | |
parent | dfefebc41275241b2e7c00d3dd57af8422705e73 (diff) | |
download | mpv-0661c59b20c2f75b2468ed95001ecf869a02eba4.tar.bz2 mpv-0661c59b20c2f75b2468ed95001ecf869a02eba4.tar.xz |
added check_events() interface
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/vo_gl.c')
-rw-r--r-- | libvo/vo_gl.c | 52 |
1 files changed, 15 insertions, 37 deletions
diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c index 4f1b4c57b1..21bbb41e65 100644 --- a/libvo/vo_gl.c +++ b/libvo/vo_gl.c @@ -32,6 +32,8 @@ LIBVO_EXTERN(gl) #include <GL/gl.h> +#include "x11_common.h" + static vo_info_t vo_info = { "X11 (OpenGL)", @@ -89,8 +91,6 @@ static resize(int x,int y){ glLoadIdentity(); } -extern void vo_decoration( Display * vo_Display,Window w,int d ); - /* connect to server, create and map window, * allocate colors and (shared) memory */ @@ -189,7 +189,7 @@ init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint3 // printf("GLXcontext ok\n"); - if ( fullscreen ) vo_decoration( mydisplay,mywindow,0 ); + if ( fullscreen ) vo_x11_decoration( mydisplay,mywindow,0 ); XSelectInput(mydisplay, mywindow, StructureNotifyMask); @@ -317,30 +317,19 @@ Terminate_Display_Process(void) X_already_started = 0; } -static void -FlipImage() + +static void check_events(void) { - int i; - XEvent Event; - char buf[100]; - KeySym keySym; - XComposeStatus stat; - unsigned long vo_KeyTable[512]; - - while ( XPending( mydisplay ) ) - { - XNextEvent( mydisplay,&Event ); - switch( Event.type ) - { - case ConfigureNotify: - resize( Event.xconfigure.width,Event.xconfigure.height ); - break; - case KeyPress: - XLookupString( &Event.xkey,buf,sizeof(buf),&keySym,&stat ); - vo_keyboard( ( (keySym&0xff00) != 0?( (keySym&0x00ff) + 256 ):( keySym ) ) ); - break; - } - } + int e=vo_x11_check_events(mydisplay); + if(e&VO_EVENT_RESIZE) resize(vo_dwidth,vo_dheight); +} + + +static void +flip_page(void) +{ + + check_events(); // glEnable(GL_TEXTURE_2D); // glBindTexture(GL_TEXTURE_2D, texture_id); @@ -359,12 +348,6 @@ FlipImage() } -static void -flip_page(void) -{ - FlipImage(); -} - //static inline uint32_t draw_slice_x11(uint8_t *src[], uint32_t slice_num) static uint32_t draw_slice(uint8_t *src[], int stride[], int w,int h,int x,int y) { @@ -418,7 +401,6 @@ int i; } // Display_Image(ImageData); -// FlipImage(); return 0; } @@ -452,7 +434,6 @@ uint8_t *de=&ImageData[3*image_width]; } // Display_Image(ImageData); -// FlipImage(); return 0; } @@ -476,7 +457,6 @@ uint8_t *ImageData=src[0]; } // Display_Image(ImageData); -// FlipImage(); return 0; } @@ -509,7 +489,5 @@ query_format(uint32_t format) static void uninit(void) { -vo_kill_eventhandler(); } - |