Re: [AD] multiple windows

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


On Thu, 2006-08-17 at 08:56 -0700, Chris Robinson wrote:
> On Thursday 17 August 2006 05:31, Elias Pschernig wrote:
> > This means, the
> > system driver should call XOpenDisplay, and all the display drivers
> > should re-use the connection.
> 
> This doesn't sound proper. IMO, an AL_DISPLAY should invoke it's own 
> connection to the server (after all, if we're mapping AL_DISPLAY to an X11 
> Display object (and the equivilant for other systems), you can't have 
> multiple AL_DISPLAYs sharing the same connection. Each window needs its own 
> Display handle, unless you're doing something like sub-windows, but that's a 
> whole nother kettle of fish.
> 
> So, I pretty much see it as:
> 
>      Window Manager
>       /         \
> X11 Event     X11 Event (WM sends events)
>     |             |
>  Display       Display  (our display code handles them)
>     |             |
>   Queue         Queue   (event is pushed onto the per-display queue)
>     |             |
>   Event         Event   (user retreives events)
> 

Yes, that's how my straight forward test ended up -
x11->al_create_display() simply opens an X11 display and creates a GLX
window. It also registers its own event handler into the background
thread (even easier would be to simply run its own thread - it still
could inject events into a global events queue).

Peter's approach is to do all the X11 setup when the system driver
starts, and also create some sort of invisible window there for handling
the keyboard (or do we already have such a window anyway?), then make
al_create_display only create sort of (or maybe actual) subwindows.

The difference is simply, how heavy an object should AL_DISPLAY be? The
fist version would make AL_DISPLAY similar to the current SYSTEM_DRIVER
(so we could have e.g. one GLX window and one SDL window, if we e.g. had
those two drivers), the second version makes it similar to the current
GFX_DRIVER.

-- 
Elias Pschernig





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