Date: Mon, 25 Oct 2004 17:30:06 +0200
From: Gautier Portet Subject: [SDL] Re: Centering a window Hi, here is a patch fixing the win32 centered window bug --HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40972
This commit is contained in:
parent
bf7fdf595e
commit
18e4eb0c76
2 changed files with 9 additions and 9 deletions
|
@ -703,12 +703,12 @@ SDL_Surface *DIB_SetVideoMode(_THIS, SDL_Surface *current,
|
||||||
if ( (flags & SDL_FULLSCREEN) ) {
|
if ( (flags & SDL_FULLSCREEN) ) {
|
||||||
x = (GetSystemMetrics(SM_CXSCREEN)-width)/2;
|
x = (GetSystemMetrics(SM_CXSCREEN)-width)/2;
|
||||||
y = (GetSystemMetrics(SM_CYSCREEN)-height)/2;
|
y = (GetSystemMetrics(SM_CYSCREEN)-height)/2;
|
||||||
} else if ( SDL_windowX || SDL_windowY || window ) {
|
|
||||||
x = bounds.left;
|
|
||||||
y = bounds.top;
|
|
||||||
} else if ( center ) {
|
} else if ( center ) {
|
||||||
x = (GetSystemMetrics(SM_CXSCREEN)-width)/2;
|
x = (GetSystemMetrics(SM_CXSCREEN)-width)/2;
|
||||||
y = (GetSystemMetrics(SM_CYSCREEN)-height)/2;
|
y = (GetSystemMetrics(SM_CYSCREEN)-height)/2;
|
||||||
|
} else if ( SDL_windowX || SDL_windowY || window ) {
|
||||||
|
x = bounds.left;
|
||||||
|
y = bounds.top;
|
||||||
} else {
|
} else {
|
||||||
x = y = -1;
|
x = y = -1;
|
||||||
swp_flags |= SWP_NOMOVE;
|
swp_flags |= SWP_NOMOVE;
|
||||||
|
|
|
@ -1168,12 +1168,12 @@ SDL_Surface *DX5_SetVideoMode(_THIS, SDL_Surface *current,
|
||||||
if ( (flags & SDL_FULLSCREEN) ) {
|
if ( (flags & SDL_FULLSCREEN) ) {
|
||||||
x = (GetSystemMetrics(SM_CXSCREEN)-width)/2;
|
x = (GetSystemMetrics(SM_CXSCREEN)-width)/2;
|
||||||
y = (GetSystemMetrics(SM_CYSCREEN)-height)/2;
|
y = (GetSystemMetrics(SM_CYSCREEN)-height)/2;
|
||||||
} else if ( SDL_windowX || SDL_windowY || window ) {
|
|
||||||
x = bounds.left;
|
|
||||||
y = bounds.top;
|
|
||||||
} else if ( center ) {
|
} else if ( center ) {
|
||||||
x = (GetSystemMetrics(SM_CXSCREEN)-width)/2;
|
x = (GetSystemMetrics(SM_CXSCREEN)-width)/2;
|
||||||
y = (GetSystemMetrics(SM_CYSCREEN)-height)/2;
|
y = (GetSystemMetrics(SM_CYSCREEN)-height)/2;
|
||||||
|
} else if ( SDL_windowX || SDL_windowY || window ) {
|
||||||
|
x = bounds.left;
|
||||||
|
y = bounds.top;
|
||||||
} else {
|
} else {
|
||||||
x = y = -1;
|
x = y = -1;
|
||||||
swp_flags |= SWP_NOMOVE;
|
swp_flags |= SWP_NOMOVE;
|
||||||
|
@ -1574,12 +1574,12 @@ SDL_Surface *DX5_SetVideoMode(_THIS, SDL_Surface *current,
|
||||||
if ( (flags & SDL_FULLSCREEN) ) {
|
if ( (flags & SDL_FULLSCREEN) ) {
|
||||||
x = (GetSystemMetrics(SM_CXSCREEN)-width)/2;
|
x = (GetSystemMetrics(SM_CXSCREEN)-width)/2;
|
||||||
y = (GetSystemMetrics(SM_CYSCREEN)-height)/2;
|
y = (GetSystemMetrics(SM_CYSCREEN)-height)/2;
|
||||||
} else if ( SDL_windowX || SDL_windowY || window ) {
|
|
||||||
x = bounds.left;
|
|
||||||
y = bounds.top;
|
|
||||||
} else if ( center ) {
|
} else if ( center ) {
|
||||||
x = (GetSystemMetrics(SM_CXSCREEN)-width)/2;
|
x = (GetSystemMetrics(SM_CXSCREEN)-width)/2;
|
||||||
y = (GetSystemMetrics(SM_CYSCREEN)-height)/2;
|
y = (GetSystemMetrics(SM_CYSCREEN)-height)/2;
|
||||||
|
} else if ( SDL_windowX || SDL_windowY || window ) {
|
||||||
|
x = bounds.left;
|
||||||
|
y = bounds.top;
|
||||||
} else {
|
} else {
|
||||||
x = y = -1;
|
x = y = -1;
|
||||||
swp_flags |= SWP_NOMOVE;
|
swp_flags |= SWP_NOMOVE;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue