mirror of
https://github.com/mpv-player/mpv
synced 2024-10-30 04:46:41 +01:00
-wid support for windows. Not well tested, might still behave a bit weird.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16283 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
e97df20692
commit
6f4bba6b61
@ -79,13 +79,11 @@ static unsigned int slice_height = 1;
|
|||||||
|
|
||||||
static void resize(int x,int y){
|
static void resize(int x,int y){
|
||||||
mp_msg(MSGT_VO, MSGL_V, "[gl] Resize: %dx%d\n",x,y);
|
mp_msg(MSGT_VO, MSGL_V, "[gl] Resize: %dx%d\n",x,y);
|
||||||
#ifndef GL_WIN32
|
|
||||||
if (WinID >= 0) {
|
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);
|
geometry(&top, &left, &w, &h, vo_screenwidth, vo_screenheight);
|
||||||
glViewport(top, left, w, h);
|
glViewport(top, left, w, h);
|
||||||
} else
|
} else
|
||||||
#endif
|
|
||||||
glViewport( 0, 0, x, y );
|
glViewport( 0, 0, x, y );
|
||||||
|
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
|
@ -504,13 +504,11 @@ static void resize(int *x,int *y){
|
|||||||
glViewport( (vo_screenwidth-*x)/2, (vo_screenheight-*y)/2, *x, *y);
|
glViewport( (vo_screenwidth-*x)/2, (vo_screenheight-*y)/2, *x, *y);
|
||||||
} else {
|
} else {
|
||||||
//aspect(x, y, A_NOZOOM);
|
//aspect(x, y, A_NOZOOM);
|
||||||
#ifndef GL_WIN32
|
|
||||||
if (WinID >= 0) {
|
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);
|
geometry(&top, &left, &w, &h, vo_screenwidth, vo_screenheight);
|
||||||
glViewport(top, left, w, h);
|
glViewport(top, left, w, h);
|
||||||
} else
|
} else
|
||||||
#endif
|
|
||||||
glViewport( 0, 0, *x, *y );
|
glViewport( 0, 0, *x, *y );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -225,11 +225,15 @@ 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, WS_POPUP, CW_USEDEFAULT, 0, 100, 100, 0, 0, hInstance, 0);
|
||||||
if (!vo_window) {
|
if (!vo_window) {
|
||||||
mp_msg(MSGT_VO, MSGL_ERR, "vo: win32: unable to create window!\n");
|
mp_msg(MSGT_VO, MSGL_ERR, "vo: win32: unable to create window!\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
vo_hdc = GetDC(vo_window);
|
vo_hdc = GetDC(vo_window);
|
||||||
|
|
||||||
@ -259,6 +263,7 @@ void vo_w32_uninit() {
|
|||||||
resetMode();
|
resetMode();
|
||||||
ShowCursor(1);
|
ShowCursor(1);
|
||||||
vo_depthonscreen = 0;
|
vo_depthonscreen = 0;
|
||||||
|
if (WinID >= 0)
|
||||||
DestroyWindow(vo_window);
|
DestroyWindow(vo_window);
|
||||||
vo_window = 0;
|
vo_window = 0;
|
||||||
UnregisterClass(classname, 0);
|
UnregisterClass(classname, 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user