Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Question about event handling

Name: Anonymous 2014-06-21 11:42

Let's say I use SDL (1.2 or 2.0) in my program to handle events, should I use callbacks or the good old giant switch statement?

Name: Anonymous 2014-06-22 16:37

>>67
Anyway, in case you are not a troll, your confusion stems from the fact you think callbacks are supposed to check the event and decide whether to act or not. Callbacks always act when they are called. You register callbacks using some mechanism provided by the event library. Thus, whether it is O(n) or O(1) to decide which callback to use, is up to the event library implementation.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List