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?
http://gameprogrammingpatterns.com/observer.htmlThat guy is surely a retrograde moron. "Observer pattern" and all other "design patterns" are just a boilerplate, completely useless in Scheme and Common Lisp, which you should be using today. I.e. observer pattern was invented to emulates closures.
Scheme and Common Lisp, which you should be using todayWhy would I use an outdated, obsolete and also unpopular language?
Use this function to add a callback to be triggered when an event is added to the event queue.
SDL_AddEventWatchdoesn't return and error and /* uh oh */ https://hg.libsdl.org/SDL/file/60edb019f0fe/src/events/SDL_events.c#l496