Enable border toggling for gl and gl2 under windows.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17007 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2005-11-17 20:49:46 +00:00
parent 618d511e43
commit 28b32a786a
3 changed files with 29 additions and 2 deletions

View File

@ -796,6 +796,11 @@ static int control(uint32_t request, void *data, ...)
vo_x11_fullscreen();
#endif
return VO_TRUE;
#ifdef GL_WIN32
case VOCTRL_BORDER:
vo_w32_border();
return VO_TRUE;
#endif
case VOCTRL_GET_PANSCAN:
if (!use_aspect) return VO_NOTIMPL;
return VO_TRUE;

View File

@ -1135,6 +1135,11 @@ static int control(uint32_t request, void *data, ...)
initGl(vo_dwidth, vo_dheight);
resize(&vo_dwidth, &vo_dheight);
return VO_TRUE;
#ifdef GL_WIN32
case VOCTRL_BORDER:
vo_w32_border();
return VO_TRUE;
#endif
case VOCTRL_GET_PANSCAN:
return VO_TRUE;
case VOCTRL_SET_PANSCAN:

View File

@ -161,7 +161,10 @@ static void resetMode(void) {
int createRenderingContext(void) {
HWND layer = HWND_NOTOPMOST;
PIXELFORMATDESCRIPTOR pfd;
RECT r;
int pf;
int style = (vo_border && !vo_fs) ?
(WS_OVERLAPPEDWINDOW | WS_SIZEBOX) : WS_POPUP;
if (vo_fs || vo_ontop) layer = HWND_TOPMOST;
if (vo_fs) {
@ -178,9 +181,16 @@ int createRenderingContext(void) {
}
}
updateScreenProperties();
ShowWindow(vo_window, SW_HIDE);
SetWindowLong(vo_window, GWL_STYLE, style);
vo_dwidth = vo_fs ? vo_screenwidth : o_dwidth;
vo_dheight = vo_fs ? vo_screenheight : o_dheight;
SetWindowPos(vo_window, layer, vo_fs ? 0 : vo_dx, vo_fs ? 0 : vo_dy, vo_dwidth, vo_dheight, SWP_SHOWWINDOW);
r.left = vo_fs ? 0 : vo_dy;
r.right = r.left + vo_dwidth;
r.top = vo_fs ? 0 : vo_dx;
r.bottom = r.top + vo_dheight;
AdjustWindowRect(&r, style, 0);
SetWindowPos(vo_window, layer, r.left, r.top, r.right - r.left, r.bottom - r.top, SWP_SHOWWINDOW);
memset(&pfd, 0, sizeof pfd);
pfd.nSize = sizeof pfd;
@ -228,7 +238,9 @@ int vo_init(void) {
if (WinID >= 0)
vo_window = WinID;
else {
vo_window = CreateWindowEx(0, classname, classname, WS_POPUP, CW_USEDEFAULT, 0, 100, 100, 0, 0, hInstance, 0);
vo_window = CreateWindowEx(0, classname, classname,
vo_border ? (WS_OVERLAPPEDWINDOW | WS_SIZEBOX) : WS_POPUP,
CW_USEDEFAULT, 0, 100, 100, 0, 0, hInstance, 0);
if (!vo_window) {
mp_msg(MSGT_VO, MSGL_ERR, "vo: win32: unable to create window!\n");
return 0;
@ -248,6 +260,11 @@ void vo_w32_fullscreen(void) {
createRenderingContext();
}
void vo_w32_border() {
vo_border = !vo_border;
createRenderingContext();
}
void vo_w32_ontop( void )
{
vo_ontop = !vo_ontop;