Re: [AD] New gfx api

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


Chris wrote:

Well, I guess I'll just have to wait and see the final implementaion then. I'm just getting more confused. Unless this is how you mean:

OS sends an event to Allegro (key pressed/released, mouse moved, etc). Allegro converts the OS event into an Allegro event. Allegro handles the event internally (updates the mouse position, key[]-mechanism, etc), then passes it to a user-installed event handler.

Is that close?


Kind of.

OS sends an event to Allegro (key pressed/released, mouse moved, etc). Allegro handles the event internally (updates the mouse position, key[]-mechanism, etc). Additionally, and only when necessary, Allegro converts the OS event into an Allegro event and places that into one or more event queues.[1] Now the background thread that handled the OS event goes back to sleep.

In the main thread, the user can take events out of event queues and act upon them. The user can also make his process sleep until an event queue is nonempty.

I don't know what a "user-installed event handler" is, but there is no such thing ;-)

Peter

[1] For extra efficiency, all the event queues share the one copy of the event. Event structures are reference counted. Once the reference count reaches zero, the event structure can be reused (to reduce mallocs).




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