Re: [AD] event hooks

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


On 2006-12-13, Elias Pschernig <elias@xxxxxxxxxx> wrote:
> 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.

Yes, I think so.

> 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.

A problem is that a single event may be delivered to multiple event
queues, a callback might be called multiple times for the same event.

> Or alternatively, have a function:
> 
> void al_event_acknowledge(AL_EVENT *event);

This is basically what I had in mind, but I was thinking of a
resize-event specific function, rather than a general acknowledgement
function.  I think this is easier to work with than a callback.

Peter





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