Developers' Diary

Event Queue

My friend Nathaniel was just watching me code, and he suggested using the event queue to process input instead of polling for every type of input every frame. To be honest I don’t exactly understand how the event queue is any faster than polling (like, at some level there must be some logic checking every key, right?), but it is much faster. Since most of the controls involve holding down keys, I’ve got a lot of code to go through and rework to use the event queue!

One response to 'Event Queue'.

Comments and pings are currently closed for 'Event Queue'.
  1. 1 the2bears
    Posted on July 17th, 2008 at 21:45. About 'Event Queue'.

    The only issue I see with using an event queue for input is determinism. Depending on how the queue is implemented the events may be dispatched from a separate thread. You never quite know when they’ll get sent and acted upon :P

    Bill