Sign in to follow this  
flodywan

SDL program creating 2 windows

Recommended Posts

Hey guys. I'm making a simple program, but it's creating 2 windows. One of the windows is the exe window, and the other is called SDL_app. I'm not sure why it's creating 2.

Also, I can't close out of the SDL_app, I can only close the program if I close the exe window.

Any ideas why it's doing this?

Share this post


Link to post
Share on other sites
What IDE are you using? What language?

If we assume the most common configuration then it's visual c++ 2008/2010 by Microsoft.

If you right click your project in the solution explorer and select properties, then you will bring up the Property window. On the left hand side click on Linker->System. In the subsystem field to the right, you can select such things as 'Console (/SUBSYSTEM:CONSOLE)' or 'Windows (/SUBSYSTEM:WINDOWS)'.

You prolly have the former activated; if you change it to the latter then you should only open one window. The former option will additionally open a console window in addition to your SDL app. This can be useful, however; you may write debug info, etc. to this as yr program runs.

The above assumes MSVC++ 2008. You didn't say what you're using so I typed in what I was using.

Quote:
Also, I can't close out of the SDL_app, I can only close the program if I close the exe window.


Are you handling the SDL_QUIT event?

Something like:


while( SDL_PollEvent( &event ) )
{
if( event.type == SDL_QUIT )
{
// Quit the program
// ...
}
}


?

If you are not handling this then that is your problem, otherwise please say more.

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