[SDL] SDL_VIDEO_WINDOW_POS under XP

Tankko Omaskio tankko at gmail.com
Sun Apr 24 16:14:46 PDT 2005


I am trying to get the SDL_VIDEO_WINDOW_POS environment variable to
work with no luck.

I set the variable in my program with:

putenv("SDL_VIDEO_WINDOW_POS=10,10");
SDL_Surface *s = SDL_SetVideoMode(width, height, 32, SDL_SWSURFACE);

But it is never picking it up.  I've compiled the sdl.dll and traced
through it, and when it gets to the place where it does a getenv(), it
comes back NULL.

Is this an issue with the DLL having the app's original environment
space, and not the space modified by the program?  If so, how is this
expected to work?

If I set the environment variable at the prompt, and then run the
program it works.

Is there a way to set this variable from within the running program? 
It's not really practical to have the user of my program setting
environment variables, or wrapping the launching of the program in a
.bat file.

Tankko



More information about the SDL mailing list