Re: [AD] Shawn's thoughts about new Allegro

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Stepan Roh wrote:

[snip]
I totally agree with Shawn that callback based input is not good. I did
callback-based event processing library in the past and it was a pain and
hard to debug. Message queues are too high-level. Polling system is
probably the most reasonable solution.



I'd like to extend al_readkey() to support all KEY_*, not just a few of them, and also add timestamps to them if possible. The current Allegro input system is very prone to frme rate variations. A sudden drop in frame rate could mean keys get dropped, controls don't respond as well, etc. For SUUTB, we built an input system over Allegro's to try and deal with this, but it's not very nice (callbacks, timers and polling all in one - yuk).

Also, al_readkey() can return an object instead of a number.
Something like:

struct KEY {
    int ascii;
    int scancode;
    long time_stamp;
};


This will mean that Allegro will need to manage an event queue of some sort.
I'm open to other suggestions.


--
- Robert J Ohannessian
"Microsoft code is probably O(n^20)" (my CS prof)
http://pages.infinit.net/voidstar/



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/