SDL window on middle of the screen

Started by
1 comment, last by Toadhead 18 years, 11 months ago
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
Advertisement
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.

#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
Nah I was searching for a multiplatform solution.
In that case I'll just make it full-screen.

Thnks for your help!

Greetings,
Rob

This topic is closed to new replies.

Advertisement