comparison src/video/windx5/SDL_dx5video.c @ 971:96671ebc50a4

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
author Sam Lantinga <slouken@libsdl.org>
date Fri, 12 Nov 2004 23:22:08 +0000
parents fd4a6847ddc0
children d31afac94eff
comparison
equal deleted inserted replaced
970:fb8b91365766 971:96671ebc50a4
1166 width = bounds.right-bounds.left; 1166 width = bounds.right-bounds.left;
1167 height = bounds.bottom-bounds.top; 1167 height = bounds.bottom-bounds.top;
1168 if ( (flags & SDL_FULLSCREEN) ) { 1168 if ( (flags & SDL_FULLSCREEN) ) {
1169 x = (GetSystemMetrics(SM_CXSCREEN)-width)/2; 1169 x = (GetSystemMetrics(SM_CXSCREEN)-width)/2;
1170 y = (GetSystemMetrics(SM_CYSCREEN)-height)/2; 1170 y = (GetSystemMetrics(SM_CYSCREEN)-height)/2;
1171 } else if ( center ) {
1172 x = (GetSystemMetrics(SM_CXSCREEN)-width)/2;
1173 y = (GetSystemMetrics(SM_CYSCREEN)-height)/2;
1171 } else if ( SDL_windowX || SDL_windowY || window ) { 1174 } else if ( SDL_windowX || SDL_windowY || window ) {
1172 x = bounds.left; 1175 x = bounds.left;
1173 y = bounds.top; 1176 y = bounds.top;
1174 } else if ( center ) {
1175 x = (GetSystemMetrics(SM_CXSCREEN)-width)/2;
1176 y = (GetSystemMetrics(SM_CYSCREEN)-height)/2;
1177 } else { 1177 } else {
1178 x = y = -1; 1178 x = y = -1;
1179 swp_flags |= SWP_NOMOVE; 1179 swp_flags |= SWP_NOMOVE;
1180 } 1180 }
1181 if ( y < 0 ) { /* Cover up title bar for more client area */ 1181 if ( y < 0 ) { /* Cover up title bar for more client area */
1572 width = bounds.right-bounds.left; 1572 width = bounds.right-bounds.left;
1573 height = bounds.bottom-bounds.top; 1573 height = bounds.bottom-bounds.top;
1574 if ( (flags & SDL_FULLSCREEN) ) { 1574 if ( (flags & SDL_FULLSCREEN) ) {
1575 x = (GetSystemMetrics(SM_CXSCREEN)-width)/2; 1575 x = (GetSystemMetrics(SM_CXSCREEN)-width)/2;
1576 y = (GetSystemMetrics(SM_CYSCREEN)-height)/2; 1576 y = (GetSystemMetrics(SM_CYSCREEN)-height)/2;
1577 } else if ( center ) {
1578 x = (GetSystemMetrics(SM_CXSCREEN)-width)/2;
1579 y = (GetSystemMetrics(SM_CYSCREEN)-height)/2;
1577 } else if ( SDL_windowX || SDL_windowY || window ) { 1580 } else if ( SDL_windowX || SDL_windowY || window ) {
1578 x = bounds.left; 1581 x = bounds.left;
1579 y = bounds.top; 1582 y = bounds.top;
1580 } else if ( center ) {
1581 x = (GetSystemMetrics(SM_CXSCREEN)-width)/2;
1582 y = (GetSystemMetrics(SM_CYSCREEN)-height)/2;
1583 } else { 1583 } else {
1584 x = y = -1; 1584 x = y = -1;
1585 swp_flags |= SWP_NOMOVE; 1585 swp_flags |= SWP_NOMOVE;
1586 } 1586 }
1587 if ( y < 0 ) { /* Cover up title bar for more client area */ 1587 if ( y < 0 ) { /* Cover up title bar for more client area */