summaryrefslogtreecommitdiffstats
path: root/libvo/vo_gl2.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2009-09-04 19:49:35 +0300
committerUoti Urpala <uau@glyph.nonexistent.invalid>2009-09-04 19:49:35 +0300
commit0e1b7765be878491565cf5e471f22b15e106164c (patch)
tree422e500c289335182a2a64934dcabf10b95e32dc /libvo/vo_gl2.c
parenta9618c1c6fe9424dfaeb1677348e0382d7252554 (diff)
parentdcfd043ea8d0c46929aad78596314d837c290d39 (diff)
downloadmpv-0e1b7765be878491565cf5e471f22b15e106164c.tar.bz2
mpv-0e1b7765be878491565cf5e471f22b15e106164c.tar.xz
Merge svn changes up to r29644
Diffstat (limited to 'libvo/vo_gl2.c')
-rw-r--r--libvo/vo_gl2.c36
1 files changed, 17 insertions, 19 deletions
diff --git a/libvo/vo_gl2.c b/libvo/vo_gl2.c
index 9e719e03c9..71361916f4 100644
--- a/libvo/vo_gl2.c
+++ b/libvo/vo_gl2.c
@@ -416,23 +416,23 @@ static void drawTextureDisplay (void)
}
-static void resize(int *x,int *y){
- mp_msg(MSGT_VO,MSGL_V,"[gl2] Resize: %dx%d\n",*x,*y);
- if( vo_fs ) {
+static void resize(int x,int y){
+ mp_msg(MSGT_VO,MSGL_V,"[gl2] Resize: %dx%d\n",x,y);
+ if(aspect_scaling()) {
glClear(GL_COLOR_BUFFER_BIT);
- aspect(x, y, A_ZOOM);
- panscan_calc();
- *x += vo_panscan_x;
- *y += vo_panscan_y;
- glViewport( (vo_screenwidth-*x)/2, (vo_screenheight-*y)/2, *x, *y);
+ aspect(&x, &y, A_WINZOOM);
+ panscan_calc_windowed();
+ x += vo_panscan_x;
+ y += vo_panscan_y;
+ glViewport( (vo_dwidth-x)/2, (vo_dheight-y)/2, x, y);
} else {
//aspect(x, y, A_NOZOOM);
if (WinID >= 0) {
- int top = 0, left = 0, w = *x, h = *y;
+ int top = 0, left = 0, w = x, h = y;
geometry(&top, &left, &w, &h, vo_screenwidth, vo_screenheight);
glViewport(top, left, w, h);
} else
- glViewport( 0, 0, *x, *y );
+ glViewport( 0, 0, x, y );
}
glMatrixMode(GL_PROJECTION);
@@ -468,9 +468,6 @@ static int config_w32(uint32_t width, uint32_t height, uint32_t d_width, uint32_
if (!vo_w32_config(d_width, d_height, flags))
return -1;
- if (vo_fs)
- aspect(&d_width, &d_height, A_ZOOM);
-
return 0;
}
@@ -590,7 +587,7 @@ static int initGl(uint32_t d_width, uint32_t d_height)
glValName(gl_bitmap_format), glValName(gl_bitmap_type),
rgb_sz, r_sz, g_sz, b_sz, a_sz, glValName(gl_internal_format));
- resize(&d_width, &d_height);
+ resize(d_width, d_height);
glClearColor( 0.0f,0.0f,0.0f,0.0f );
glClear( GL_COLOR_BUFFER_BIT );
@@ -619,7 +616,8 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin
#endif
return -1;
- setGlWindow(&gl_vinfo, &gl_context, vo_window);
+ if (setGlWindow(&gl_vinfo, &gl_context, vo_window) == SET_WINDOW_FAILED)
+ return -1;
glVersion = glGetString(GL_VERSION);
@@ -700,7 +698,7 @@ static void check_events(void)
}
#endif
e=vo_check_events();
- if(e&VO_EVENT_RESIZE) resize(&vo_dwidth, &vo_dheight);
+ if(e&VO_EVENT_RESIZE) resize(vo_dwidth, vo_dheight);
if(e&VO_EVENT_EXPOSE && int_pause) flip_page();
}
@@ -720,7 +718,7 @@ flip_page(void)
glFinish();
swapGlBuffers();
- if (vo_fs) // Avoid flickering borders in fullscreen mode
+ if (aspect_scaling()) // Avoid flickering borders in fullscreen mode
glClear (GL_COLOR_BUFFER_BIT);
}
@@ -871,7 +869,7 @@ static int control(uint32_t request, void *data)
vo_fullscreen();
if (setGlWindow(&gl_vinfo, &gl_context, vo_window) == SET_WINDOW_REINIT)
initGl(vo_dwidth, vo_dheight);
- resize(&vo_dwidth, &vo_dheight);
+ resize(vo_dwidth, vo_dheight);
return VO_TRUE;
case VOCTRL_BORDER:
vo_gl_border();
@@ -879,7 +877,7 @@ static int control(uint32_t request, void *data)
case VOCTRL_GET_PANSCAN:
return VO_TRUE;
case VOCTRL_SET_PANSCAN:
- resize (&vo_dwidth, &vo_dheight);
+ resize(vo_dwidth, vo_dheight);
return VO_TRUE;
#ifndef GL_WIN32
case VOCTRL_SET_EQUALIZER: