diff options
| author | Japa | 2011-07-16 20:25:38 +0000 |
|---|---|---|
| committer | Japa | 2011-07-16 20:25:38 +0000 |
| commit | 3eacec9eef6da5e6ce6f7d966a6b601f6268557c (patch) | |
| tree | a3f5aa3ede09e0a916be3256104fb3319b482d90 /main.cpp | |
| parent | 0c4c063bc1df25c4b9c8941321fa5c76dc070781 (diff) | |
| download | stonesense-3eacec9eef6da5e6ce6f7d966a6b601f6268557c.tar.gz stonesense-3eacec9eef6da5e6ce6f7d966a6b601f6268557c.tar.bz2 stonesense-3eacec9eef6da5e6ce6f7d966a6b601f6268557c.tar.xz | |
Got windows to stop repeating events.
Diffstat (limited to 'main.cpp')
| -rw-r--r-- | main.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -91,9 +91,11 @@ static void main_loop(ALLEGRO_DISPLAY * display, ALLEGRO_EVENT_QUEUE *queue, ALL con.print("Focus on the main window (black) and press keys to see events. \n");
con.print("Escape quits.\n\n");
- while (!al_get_thread_should_stop(thred)) {
+ while (!al_get_thread_should_stop(thred))
+ {
/* Take the next event out of the event queue, and store it in `event'. */
- al_wait_for_event_timed(queue, &event, 1.0f);
+ bool in_time = 0;
+ in_time = al_wait_for_event_timed(queue, &event, 1.0f);
/* Check what type of event we got and act accordingly. ALLEGRO_EVENT
* is a union type and interpretation of its contents is dependent on
@@ -104,8 +106,10 @@ static void main_loop(ALLEGRO_DISPLAY * display, ALLEGRO_EVENT_QUEUE *queue, ALL * fields respectively, e.g. 'event.any.timestamp'
*/
+ if(in_time)
{
- switch (event.type) {
+ switch (event.type)
+ {
/* ALLEGRO_EVENT_KEY_DOWN - a keyboard key was pressed.
*/
|
