From 881f0f083fa7c3888e178d137b2bfdf0168b0a9a Mon Sep 17 00:00:00 2001 From: reimar Date: Mon, 30 May 2005 08:45:21 +0000 Subject: [PATCH] -geometry support for gl2 under win, default window pos centered for gl, gl2 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15596 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/man/en/mplayer.1 | 2 +- libvo/vo_gl.c | 2 ++ libvo/vo_gl2.c | 2 ++ libvo/w32_common.c | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1 index 1f22c0bf7c..94978bb6c2 100644 --- a/DOCS/man/en/mplayer.1 +++ b/DOCS/man/en/mplayer.1 @@ -2154,7 +2154,7 @@ than the screen. .br .I NOTE: This option is only supported by the x11, xmga, xv, xvmc, xvidix, -gl, gl2 (except under Windows), directx and tdfxfb video output drivers. +gl, gl2, directx and tdfxfb video output drivers. .sp 1 .I EXAMPLE: .PD 0 diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c index b3e58b4052..35225e09b1 100644 --- a/libvo/vo_gl.c +++ b/libvo/vo_gl.c @@ -162,6 +162,8 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin aspect_save_screenres(vo_screenwidth,vo_screenheight); aspect(&d_width,&d_height,A_NOZOOM); + vo_dx = (vo_screenwidth - d_width) / 2; + vo_dy = (vo_screenheight - d_height) / 2; geometry(&vo_dx, &vo_dy, &d_width, &d_height, vo_screenwidth, vo_screenheight); #ifdef X11_FULLSCREEN diff --git a/libvo/vo_gl2.c b/libvo/vo_gl2.c index e52f149232..646f11c84a 100644 --- a/libvo/vo_gl2.c +++ b/libvo/vo_gl2.c @@ -829,6 +829,8 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin aspect_save_screenres(vo_screenwidth,vo_screenheight); aspect(&d_width,&d_height,A_NOZOOM); + vo_dx = (vo_screenwidth - d_width) / 2; + vo_dy = (vo_screenheight - d_height) / 2; geometry(&vo_dx, &vo_dy, &d_width, &d_height, vo_screenwidth, vo_screenheight); diff --git a/libvo/w32_common.c b/libvo/w32_common.c index 60e38d3555..c23afe679d 100644 --- a/libvo/w32_common.c +++ b/libvo/w32_common.c @@ -180,7 +180,7 @@ int createRenderingContext(void) { updateScreenProperties(); vo_dwidth = vo_fs ? vo_screenwidth : o_dwidth; vo_dheight = vo_fs ? vo_screenheight : o_dheight; - SetWindowPos(vo_window, layer, (vo_screenwidth - vo_dwidth) / 2, (vo_screenheight - vo_dheight) / 2, vo_dwidth, vo_dheight, SWP_SHOWWINDOW); + SetWindowPos(vo_window, layer, vo_dx, vo_dy, vo_dwidth, vo_dheight, SWP_SHOWWINDOW); PIXELFORMATDESCRIPTOR pfd; memset(&pfd, 0, sizeof pfd);