[AD] event hooks

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


Hi,

I have a question about resizable windows in 4.3, mainly to Peter
(Wang) :)

The problem is, doing the resizing asynchronously, that is, change
internal display dimensions, clipping, OpenGL setup, and so on,
asynchronously from the background thread whenever an X11 resize event
is received, seems like a very bad idea.

Therefore, I'd like to add a field:

void (*callback)(AL_EVENT *event);

to the current AL_EVENT struct. The display driver would fill in this
callback to resize events with an internal function to handle the actual
window resizing (update internal AL_DISPLAY/driver/OpenGL stuff).

The callback then would, if not NULL, get called from al_next_event,
just before delivering the event to the user. That way, resizes could be
handled synchronously, from a fixed location in the main thread.

Or alternatively, have a function:

void al_event_acknowledge(AL_EVENT *event);

And have the user call it in response to certain events, like
AL_EVENT_DISPLAY_RESIZE events. The event callback would then be called
in there.

I think I prefer having it auto-called from al_next_event though.

Anyway, does it seems reasonable to add such a callback mechanism to the
events API?

-- 
Elias Pschernig





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