SDL secondary window closing error
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:
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].
// 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
Popular Topics
Advertisement