Mercurial > sdl-ios-xcode
comparison src/video/windib/SDL_dibvideo.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 | f72cc0c7305f |
children | d31afac94eff |
comparison
equal
deleted
inserted
replaced
970:fb8b91365766 | 971:96671ebc50a4 |
---|---|
701 width = bounds.right-bounds.left; | 701 width = bounds.right-bounds.left; |
702 height = bounds.bottom-bounds.top; | 702 height = bounds.bottom-bounds.top; |
703 if ( (flags & SDL_FULLSCREEN) ) { | 703 if ( (flags & SDL_FULLSCREEN) ) { |
704 x = (GetSystemMetrics(SM_CXSCREEN)-width)/2; | 704 x = (GetSystemMetrics(SM_CXSCREEN)-width)/2; |
705 y = (GetSystemMetrics(SM_CYSCREEN)-height)/2; | 705 y = (GetSystemMetrics(SM_CYSCREEN)-height)/2; |
706 } else if ( center ) { | |
707 x = (GetSystemMetrics(SM_CXSCREEN)-width)/2; | |
708 y = (GetSystemMetrics(SM_CYSCREEN)-height)/2; | |
706 } else if ( SDL_windowX || SDL_windowY || window ) { | 709 } else if ( SDL_windowX || SDL_windowY || window ) { |
707 x = bounds.left; | 710 x = bounds.left; |
708 y = bounds.top; | 711 y = bounds.top; |
709 } else if ( center ) { | |
710 x = (GetSystemMetrics(SM_CXSCREEN)-width)/2; | |
711 y = (GetSystemMetrics(SM_CYSCREEN)-height)/2; | |
712 } else { | 712 } else { |
713 x = y = -1; | 713 x = y = -1; |
714 swp_flags |= SWP_NOMOVE; | 714 swp_flags |= SWP_NOMOVE; |
715 } | 715 } |
716 if ( y < 0 ) { /* Cover up title bar for more client area */ | 716 if ( y < 0 ) { /* Cover up title bar for more client area */ |