summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-02-09 14:14:35 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-02-09 14:14:35 +0000
commit83834ac9687d1c121b5fa98530f13806e824a9a2 (patch)
treed0dff94dc40496016e00e665e888a8c2d6dd8927 /libvo
parent325b472ae6ef6ffcd9f80626b586dedb892add09 (diff)
downloadmpv-83834ac9687d1c121b5fa98530f13806e824a9a2.tar.bz2
mpv-83834ac9687d1c121b5fa98530f13806e824a9a2.tar.xz
Hack: Create a child window for Windows OpenGL with -wid, since (esp. nVidia)
drivers have problems drawing in other processes' windows. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25965 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/w32_common.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/libvo/w32_common.c b/libvo/w32_common.c
index ab1c245055..d2fa92f609 100644
--- a/libvo/w32_common.c
+++ b/libvo/w32_common.c
@@ -156,11 +156,9 @@ int vo_w32_check_events(void) {
}
if (WinID >= 0) {
RECT r;
- GetClientRect(vo_window, &r);
+ GetClientRect(WinID, &r);
if (r.right != vo_dwidth || r.bottom != vo_dheight)
- event_flags |= VO_EVENT_RESIZE;
- vo_dwidth = r.right;
- vo_dheight = r.bottom;
+ MoveWindow(vo_window, 0, 0, r.right, r.bottom, FALSE);
}
return event_flags;
@@ -372,8 +370,14 @@ int vo_w32_init(void) {
}
if (WinID >= 0)
- vo_window = (HWND)WinID;
- else {
+ {
+ RECT r;
+ GetClientRect(WinID, &r);
+ vo_dwidth = r.right; vo_dheight = r.bottom;
+ vo_window = CreateWindowEx(0, classname, classname,
+ WS_CHILD | WS_VISIBLE,
+ 0, 0, vo_dwidth, vo_dheight, WinID, 0, hInstance, 0);
+ } else
vo_window = CreateWindowEx(0, classname, classname,
vo_border ? (WS_OVERLAPPEDWINDOW | WS_SIZEBOX) : WS_POPUP,
CW_USEDEFAULT, 0, 100, 100, 0, 0, hInstance, 0);
@@ -381,7 +385,6 @@ int vo_w32_init(void) {
mp_msg(MSGT_VO, MSGL_ERR, "vo: win32: unable to create window!\n");
return 0;
}
- }
myMonitorFromWindow = NULL;
myGetMonitorInfo = NULL;
@@ -421,7 +424,6 @@ void vo_w32_uninit(void) {
resetMode();
ShowCursor(1);
vo_depthonscreen = 0;
- if (WinID < 0)
DestroyWindow(vo_window);
vo_window = 0;
UnregisterClass(classname, 0);