[SDL] moving screen when u change resolution

Bob Pendleton bob at pendleton.com
Fri Jan 28 14:16:50 PST 2005

On Fri, 2005-01-28 at 21:16 +0000, zed zeek wrote:
> gidday im using sdl with opengl, now i can change
> screensizes no problems (i have to reload the textures
> + glsl shaders again but thats sorted) the thing is i
> cant seem to update either of the following
> putenv( "SDL_VIDEO_CENTERED=1" );
> putenv( "SDL_VIDEO_WINDOW_POS=100,100" );
> useful to keep the new screensize in the center of the
> screen, what exact steps do i need to do to recify
> this.
> cheers zed

I don't usually go to the source to try to answer a question, but this
one caught my attention so I looked at source for SDL_x11video.c and
SDL_dx5video.c and it looks like in both cases the environment variables
are only checked if you are creating a completely new window, but not if
you are changing an existing window. The code is in the device level
version of SDL_SetVideoMode() for a specific system. 

Of course, I could be completely wrong, but this looks a bit like a bug
to me. Could be that a change is needed in every driver that uses those
flags. A thorough person would check all the environment variable code
to make sure the environment variables are checked every time
SDL_SetVideoMode() is called. 

My belief is that if you call SDL_quit(), change the environment
variables, and then call SDL_Init() and SDL_SetVideoMode() you should
see a change.

		Bob Pendleton

> ___________________________________________________________ 
> ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com
> _______________________________________________
> SDL mailing list
> SDL at libsdl.org
> http://www.libsdl.org/mailman/listinfo/sdl

More information about the SDL mailing list