Re: [AD] New gfx api

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


Angelo Mottola wrote:
I was thinking about this whole events stuff... Currently, you have to create at least one event queue and attach event sources to it. Then you regularly query this queue for events.

I don't think I properly understand these event sources and queue stuff. The way I understand it, if you'd want to read the keyboard, you'd have to manually check for events and use them until the queue is empty (polling, in essence.. which I thought we didn't want). I prefer the way Allegro currently does it, where the key[] array is updated asyncronously and holds the state of the keyboard keys at any given moment in time. The closest thing I can think of to the event queue is keypressed/readkey, which I usually try to avoid unless I need Allegro to do any key shifting for me or what-not.

This requires some lines of code to initialize a program that properly gets input. Can't we have an internal global queue, on which all event sources are automatically attached when created? Then an user could just specify NULL as event queue and this global queue is used instead. What do you think?

If I'm understanding it right, I like this idea very much. The goal of Allegro should be to hide this event stuff and just give you what you need. Adding a layer on top of the OS that behaves like the OS with another layer that behaves like Allegro does currently is overkill, IMO.

- Kitty Cat




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