SDL window on middle of the screen
Hello,
Is it possible to let the window you get from SDL_SetVideoMode() start at the middle of the screen instead of just at some random place?
I mean want to have a small window, with no frames in the middle of the screen. But it will just go to the top right corner of the left bottom of the screen etc.
I hope someone knows a solution.
Greetings,
Rob
if you want a multiplatform solution, you can't. If you want a windows-only solution then you can have a look at SDL_GetWMInfo function.
with the HWND of the main window, you can use Win32 API functions to do whatever you want with the window.
PS: This question has been asked before, you can found the post here
#include <SDL/SDL_syswm.h> // you must include this, as it's not // included in SDL.hint main(int argc,char *argv[]){ SDL_SysWMInfo wminfo; HWND hwnd;//SDL initialization, main window creation, etc//... SDL_VERSION(&wminfo.version); SDL_GetWMInfo(&wminfo); hwnd=wminfo.window;//do whatever you want with the window }
with the HWND of the main window, you can use Win32 API functions to do whatever you want with the window.
PS: This question has been asked before, you can found the post here
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement