summaryrefslogtreecommitdiffstats
path: root/libvo/vo_gl2.c
diff options
context:
space:
mode:
authormosu <mosu@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-08-31 22:27:10 +0000
committermosu <mosu@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-08-31 22:27:10 +0000
commit908e6a761d276dc98fac7e2340bd67ff66dff235 (patch)
tree9a5a347a6e21080000ac6eb10c489448f75c7450 /libvo/vo_gl2.c
parente479f2bb26dee3dd7a87bbb9557bd0a130979e85 (diff)
downloadmpv-908e6a761d276dc98fac7e2340bd67ff66dff235.tar.bz2
mpv-908e6a761d276dc98fac7e2340bd67ff66dff235.tar.xz
Avoid flickering during resizes. Keep video contents even when paused. Fix by Tomas Simonaitis <haden@homelan.lt>
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10758 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/vo_gl2.c')
-rw-r--r--libvo/vo_gl2.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/libvo/vo_gl2.c b/libvo/vo_gl2.c
index f2e0d66cf6..0b173850fd 100644
--- a/libvo/vo_gl2.c
+++ b/libvo/vo_gl2.c
@@ -64,6 +64,8 @@ static uint32_t image_bpp;
static int image_mode;
static uint32_t image_bytes;
+static int int_pause;
+
static uint32_t texture_width;
static uint32_t texture_height;
static int texnumx, texnumy, memory_x_len, memory_x_start_offset, raw_line_len;
@@ -86,6 +88,7 @@ static int gl_antialias=0;
static void (*draw_alpha_fnc)
(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride);
+
/* The squares that are tiled to make up the game screen polygon */
struct TexSquare
@@ -642,14 +645,14 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin
XEvent xev;
// XGCValues xgcv;
- XSetWindowAttributes xswa;
- unsigned long xswamask;
const unsigned char * glVersion;
image_height = height;
image_width = width;
image_format = format;
+
+ int_pause = 0;
aspect_save_orig(width,height);
aspect_save_prescale(d_width,d_height);
@@ -691,15 +694,10 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin
return -1;
}
- xswa.background_pixel = 0;
- xswa.border_pixel = 1;
- xswa.colormap = vo_x11_create_colormap(vinfo);
- xswamask = CWBackPixel | CWBorderPixel | CWColormap;
-
if ( vo_window == None )
{
- vo_window = XCreateWindow(mDisplay, RootWindow(mDisplay,mScreen), hint.x, hint.y, hint.width, hint.height, 4, vinfo->depth,CopyFromParent,vinfo->visual,xswamask,&xswa);
-
+ vo_window = vo_x11_create_smooth_window(mDisplay, RootWindow(mDisplay,mScreen),
+ vinfo->visual, hint.x, hint.y, hint.width, hint.height, vinfo->depth, vo_x11_create_colormap(vinfo));
if ( flags&0x01 ) vo_x11_decoration( mDisplay,vo_window,0 );
XSelectInput(mDisplay, vo_window, StructureNotifyMask);
@@ -741,7 +739,7 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin
//XSelectInput(mDisplay, vo_window, StructureNotifyMask); // !!!!
vo_x11_selectinput_witherr(mDisplay, vo_window, StructureNotifyMask | KeyPressMask | PointerMotionMask
- | ButtonPressMask | ButtonReleaseMask
+ | ButtonPressMask | ButtonReleaseMask | ExposureMask
);
glVersion = glGetString(GL_VERSION);
@@ -965,7 +963,7 @@ static void check_events(void)
int key;
static XComposeStatus stat;
int e;
-
+
while ( XPending( mDisplay ) )
{
XNextEvent( mDisplay,&Event );
@@ -983,8 +981,9 @@ static void check_events(void)
break;
}
}
- e=vo_x11_check_events(mDisplay);
+ e=vo_x11_check_events(mDisplay);
if(e&VO_EVENT_RESIZE) resize(vo_dwidth,vo_dheight);
+ if(e&VO_EVENT_EXPOSE && int_pause) flip_page();
}
static void draw_osd(void)
@@ -1079,6 +1078,8 @@ static uint32_t preinit(const char *arg)
static uint32_t control(uint32_t request, void *data, ...)
{
switch (request) {
+ case VOCTRL_PAUSE: return (int_pause=1);
+ case VOCTRL_RESUME: return (int_pause=0);
case VOCTRL_QUERY_FORMAT:
return query_format(*((uint32_t*)data));
case VOCTRL_FULLSCREEN: