Advertisement

SDL secondary window closing error

Started by January 22, 2005 11:15 PM
0 comments, last by Drew_Benton 19 years, 7 months ago
I've been messing around lately making a multiplayer battleship game. I had my girlfriend testing it with me and she ended up using the X close button on the secondary window (the one I don't display my graphics on) instead of the primary graphics window and it gives an error. Any way around this?
One way is to create a "Win32 App" instead of a "Win32 Console" for SDL. You can easily change this at link time with the following code:

// Use Win32 Window mode instead of console#ifdef WINDOW	#pragma comment ( linker, "/ENTRY:WinMainCRTStartup" )	#pragma comment ( linker, "/SUBSYSTEM:WINDOWS" )#endif// Use Console mode instead of Window#ifdef CONSOLE	#pragma comment ( linker, "/ENTRY:mainCRTStartup" )	#pragma comment ( linker, "/SUBSYSTEM:CONSOLE" )#endif


Just either: #define WINDOW when she wants to play or #define CONSOLE when you develop it [smile]. Do this before the previous #ifdefs. Hope this helps!

- Drew

[edit] This causes a problem because the application is prematurly terminated before it should be. It would be to much work to get it to fix closing that secondary window - trust me [wink].

This topic is closed to new replies.

Advertisement