Skip to content

Commit

Permalink
Date: Mon, 25 Oct 2004 17:30:06 +0200
Browse files Browse the repository at this point in the history
From: Gautier Portet
Subject: [SDL] Re: Centering a window

Hi, here is a patch fixing the win32 centered window bug
  • Loading branch information
slouken committed Nov 12, 2004
1 parent 3ff35b6 commit b8d057e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/video/windib/SDL_dibvideo.c
Expand Up @@ -703,12 +703,12 @@ SDL_Surface *DIB_SetVideoMode(_THIS, SDL_Surface *current,
if ( (flags & SDL_FULLSCREEN) ) {
x = (GetSystemMetrics(SM_CXSCREEN)-width)/2;
y = (GetSystemMetrics(SM_CYSCREEN)-height)/2;
} else if ( SDL_windowX || SDL_windowY || window ) {
x = bounds.left;
y = bounds.top;
} else if ( center ) {
x = (GetSystemMetrics(SM_CXSCREEN)-width)/2;
y = (GetSystemMetrics(SM_CYSCREEN)-height)/2;
} else if ( SDL_windowX || SDL_windowY || window ) {
x = bounds.left;
y = bounds.top;
} else {
x = y = -1;
swp_flags |= SWP_NOMOVE;
Expand Down
12 changes: 6 additions & 6 deletions src/video/windx5/SDL_dx5video.c
Expand Up @@ -1168,12 +1168,12 @@ SDL_Surface *DX5_SetVideoMode(_THIS, SDL_Surface *current,
if ( (flags & SDL_FULLSCREEN) ) {
x = (GetSystemMetrics(SM_CXSCREEN)-width)/2;
y = (GetSystemMetrics(SM_CYSCREEN)-height)/2;
} else if ( SDL_windowX || SDL_windowY || window ) {
x = bounds.left;
y = bounds.top;
} else if ( center ) {
x = (GetSystemMetrics(SM_CXSCREEN)-width)/2;
y = (GetSystemMetrics(SM_CYSCREEN)-height)/2;
} else if ( SDL_windowX || SDL_windowY || window ) {
x = bounds.left;
y = bounds.top;
} else {
x = y = -1;
swp_flags |= SWP_NOMOVE;
Expand Down Expand Up @@ -1574,12 +1574,12 @@ SDL_Surface *DX5_SetVideoMode(_THIS, SDL_Surface *current,
if ( (flags & SDL_FULLSCREEN) ) {
x = (GetSystemMetrics(SM_CXSCREEN)-width)/2;
y = (GetSystemMetrics(SM_CYSCREEN)-height)/2;
} else if ( SDL_windowX || SDL_windowY || window ) {
x = bounds.left;
y = bounds.top;
} else if ( center ) {
x = (GetSystemMetrics(SM_CXSCREEN)-width)/2;
y = (GetSystemMetrics(SM_CYSCREEN)-height)/2;
} else if ( SDL_windowX || SDL_windowY || window ) {
x = bounds.left;
y = bounds.top;
} else {
x = y = -1;
swp_flags |= SWP_NOMOVE;
Expand Down

0 comments on commit b8d057e

Please sign in to comment.