Re: [AD] X window creation

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


On Thu, Mar 16, 2000 at 05:16:13PM +0000, Shawn Hargreaves wrote:
> My main reason for doing this change was as a first step towards 
> supporting a way of attaching Allegro drawing onto an existing window: if 
> we are going to add functions for that at some point, it is important to 
> be able to initialise the system without creating a window automatically, 
> so you later have the option of either calling set_gfx_mode() or 
> attaching it to an existing window(s) of your own.

This is almost something that AllegroGL will benefit from.  John
Harger recently sent me a patch, allowing the Windows driver to
initialise after Allegro, and putting everything inside an
Allegro GFX_DRIVER, along with a few primitives in the vtable.
I've ported this to X, but in the current WIPs there are
problems because I need to bind the window to a special visual,
which (AFAIK) isn't possible after it's already been created.
So, rather recklessly, I am destroying the window and creating a
new one to my specifications.  One drawback is that if the
keyboard is installed before the graphics mode is set, input
doesn't work after I create a new window.  Does your system
suffer from this too?  Another is that now Allegro's window has
a funny OpenGL visual, and I suspect that Allegro's normal
graphics drivers might get confused by it.

I think it would be great if we could open windows when the
graphics mode is set and close them afterwards -- this would
make life a lot easier for AllegroGL, and intuitively makes more
sense to me.  The difference between this and your system is
a sort of symmetry -- the created window doesn't last from one
graphics driver to the next; each gets the chance to set up
whichever window suits it best.

The only problem I can see with this is what Michael said about
not being able to get input, and what I found above about input
getting disabled when we close and reopen the window.
Presumably it would be fairly simple to detect which of the
non-graphical systems depending on the window are initialised,
and ask them to bind themselves to the new window after creating
it.

Michael wrote some time ago about a method for getting input
using a second window (maybe not even mapped?), in order to
remove the need for calling ENABLE and DISABLE from any user
code which calls X functions.  Would that solve this problem
too, and is it feasible?  If we want this implemented, and
Michael doesn't have time, then I might be able to.  I don't
know too much about X, though.

George

-- 
Random project update:
06/02/2000: AllegroGL alpha 3: use OpenGL with Allegro in Unix or Windows
	http://www.canvaslink.com/gfoot/allegrogl/



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