Jump to content
  • Advertisement
Sign in to follow this  
flodywan

SDL program creating 2 windows

This topic is 2749 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!