-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
After creating the drawing panel, call SetFocus() on it and use Connect() to bind keyboard events from it. Add the wxWANTS_CHARS flag to all DrawingArea subclasses so that wxEVT_CHAR_HOOK can be used instead of wxEVT_KEY_DOWN, because it is more general and catches more keys. Change the process_key_press function to return a bool indicating whether a game control is currently pressed or not, this is used in the key events to determine whether the event should be propagated or not. If in a game key, do not propagate the event, otherwise it hits one of the other controls and generates a beep sound. The menu open/closed/highlighted events had to be turned off for Mac, because the menubar is catching all keyboard events for some reason even before they reach the drawing panel event handler. So on Mac the game will not be paused when the menu is being used, this is not really a big deal and can be fixed later. Other improvements: * do not bundle and link dylibs when CMAKE_BUILD_TYPE is not "Release", this makes for quicker debug builds * finally make a generic PaintEv for the DrawingPanel abstract base class using dynamic_cast<> and Bind(), unfortunately this is not wx 2.8 compatible * set the default audio_buffers to 10 instead of 5, this completely or almost completely fixes sound stuttering during normal game play on Mac with OpenAL * spew path info on startup only once
- Loading branch information
Showing
6 changed files
with
65 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters