Yet another window position question

Someone on the list mentioned that they had a kludge for positioning
the window. Can someone point me to that? It’s OK if its Win only
for now.

Can you get a hWnd to the window and force messages to it?

Also, does anyone know why the window doesn’t start in the same place
every time? It’s mostly in the upper left corner, but seems to move
around a lot (WinXP). Sometimes it will be a few hundred pixels from
the corner, sometimes more, sometimes less, but it seems to creep down
the screen, then start back at the top.

I’ve heard the window is supposed to start centered, but that doesn’t
happen (and I don’t want it to while I’m debugging).

I’ve tried searching the archives, but I’ve only found tidbits via
Google (is there an official search for the archives?)

Tankko

Someone on the list mentioned that they had a kludge for positioning
the window. Can someone point me to that? It’s OK if its Win only
for now.

Here’s the link you requested:

http://sdldoc.csn.ul.ie/sdlenvvars.php

Also, does anyone know why the window doesn’t start in the same place
every time? It’s mostly in the upper left corner, but seems to move

I doubt this has anything to do with SDL, more like your Window
Manager and whatever postion setting it’s using.

I’ve heard the window is supposed to start centered, but that doesn’t
happen (and I don’t want it to while I’m debugging).

From the SDL_doc:

“Several environment variables are available to modify the behaviour
of SDL. Using these variables isn’t recommened and the names and
presence of these variables aren’t guaranteed from one release to the
next. However, they can be very useful for debugging purposes.”

Aside from SDL_envvars there is no other way, short of rolling your
own, to specify a SDL’s window position.

Good luck.On Apr 10, 2005 8:51 PM, Tankko Omaskio wrote:

'lo Tankko,On 11/04/2005, Tankko Omaskio, you wrote:

Also, does anyone know why the window doesn’t start in the same place
every time? It’s mostly in the upper left corner, but seems to move
around a lot (WinXP).

I find that annoying too. The behaviour in SDL 1.2.6 was to open the
window centered. I suggest you use SDL 1.2.6 because of this and other
problems related to full screen / windowed switches.

Or, you could try putenv( “SDL_VIDEO_CENTERED=1” ) before
SDL_SetVideoMode().


Please remove “.ARGL.invalid” from my email when replying.
Incoming HTML mails are automatically deleted.