SDL apps open with wrong window size

Started by
5 comments, last by blackwizard 18 years ago
Im using SDL with Dev-cpp. Whenever i open a program i made it opens in a tiny window. It looks like i set the surface with: SDL_SetVideoMode(100, 0, 32, SDL_SWSURFACE); Once i move the window it flicks back 2 the size i set it 2 be (800x600) but its really getting on my nerves. I reckon windows registry must hav saved that size but i dont know much about the registry. Any1 have any suggestions? I cant find a solution and iv been googling it for ages!
Advertisement
SDL doesn't store any information about its window.

Have you tried a call to MoveWindow() or ShowWindow() (both are Windows API functions) somewhere in your initialization function?

This should do the same as you moving the window manually, not a fix for the actual problem but I can't think of anything else.
What do i use for the HWND value?
Im a bit new to this.
Also it only happens on my laptop and only with sdl applications (i think).
My apps open fine on other comps.
Take a look at d window, its my avatar on this site, kinda funny:
http://www.ozzu.com/ftopic61018.html
You retrieve the HWND like so:

SDL_SysWMinfo info;SDL_VERSION(&info.version);SDL_GetWMInfo(&info);MoveWindow(info.window, x, y, w, h, TRUE);


By the way is this WindowBlinds you running there or the Vista Beta or something? Maybe that would explain it.
Quote:Original post by blackwizard
SDL_SetVideoMode(100, 0, 32, SDL_SWSURFACE);


Hm, why are you passing 100 for the width and 0 for the height? Does that still work? On my computer, if I pass in 0 for the height, it fails to run, even if I disable the Windows application style (SDL_NOFRAME). I'd suggest try not making the height 0, rather a larger smaller number, and see if it still does what you want it to do. On windows, all windows that use a certain window style have to have a minimal height. I'm not so sure on Windows what happens, but I bet it can be attributed to the weird results you are having.
Its alienguise and its also the problem. I uninstalled it and the app opens normally. Reinstalled and d problems back. Weird since it wasnt always like that.

And im not actually setting it as 100x0 dats only wat it looks like.
MoveWindow() and ShowWindow() dont change anythin. Nice1 tinkin of d theme. Thanks for your help anyway.

This topic is closed to new replies.

Advertisement