Sign in to follow this  
blackwizard

SDL apps open with wrong window size

Recommended Posts

blackwizard    122
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!

Share this post


Link to post
Share on other sites
basement    229
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.

Share this post


Link to post
Share on other sites
blackwizard    122
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

Share this post


Link to post
Share on other sites
basement    229
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.

Share this post


Link to post
Share on other sites
Drew_Benton    1861
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.

Share this post


Link to post
Share on other sites
blackwizard    122
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this