Sdl/opengl window position

Hello, I’m wondering how you can manually set the window position of an SDL/opengl window, because mine just goes on the screen at any random place; with an 800x600 window, that means the bottom of the window isn’t automatically visible. I noticed it’s easy to do set window position with a windows gui app, you just run some parameters in the window definition. Any knowledge/help would be appreciated. -B

Hi,

You can center the SDL+OpenGL window with following code:
//-----------------------------------------------------------
putenv(strdup(“SDL_VIDEO_CENTERED=1”));
//-----------------------------------------------------------
(call above BEFORE you call SDL_SetVideoMode)

Hope that helps!

JeZ+Lee
www.SilentHeroProductions.com

bala_48225 wrote:> Hello, I’m wondering how you can manually set the window position of

an SDL/opengl window, because mine just goes on the screen at any
random place; with an 800x600 window, that means the bottom of the
window isn’t automatically visible. I noticed it’s easy to do set
window position with a windows gui app, you just run some parameters
in the window definition. Any knowledge/help would be appreciated. -B


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Yes, that does help alot, thanks jez-l-lee :smiley: