[cairo] glitz-glx

David Reveman c99drn at cs.umu.se
Sat May 22 03:31:37 PDT 2004

On Fri, 2004-05-21 at 20:55 -0700, Jon Smirl wrote: 
> I'm trying to get glitz working on miniglx. Miniglx is a very primitive system,
> it can only handle one X window. glitztest.c is creating two windows, a root one
> and one for the surface. What is the root window used for? I'm trying to trace
> around the code but I haven't it out yet. Can I eliminate the root window or
> close it before the surface window is opened?

We need to have a GLX drawable "current" to query extensions. This is
one reason for the creation of the root window. The root window is also
used when no pbuffer support is available and the application creates an
offscreen surface before it has created an onscreen one (no pbuffer
support means offscreen surfaces == textures, textures need a GLX
drawable "current" to be created).

You can probably close the root window before the surface window is
opened but that might break read/draw pixels to offscreen surfaces.

> Miniglx is part of mesa-solo. Mesa-solo is the OpenGL version that runs
> standalone without needing Xfree. Bringing glitz up on mesa-solo is a first step
> to bring xserver up.

I've been planning to get glitz running with miniglx but I haven't 
had the time to look at this yet.

> Would it be better if I started another backend for glitz - glx, agl, solo? The
> solo environment does not eumulate the X event system very well. Instead you
> need to read directly from the mouse/keyboard devices. It also doesn't have much
> of a windowing system, instead you just run fullscreen.

I don't know much about mesa-solo, what are the alternatives to using
mesa-solo through miniglx? Can we use mesa-solo directly? If there are some
advantages of using mesa-solo directly, then I definitely think we should
create a mesa-solo backend for glitz, otherwise we should get the GLX
backend working with miniglx.

Whether or not we create a mesa-solo backend, I still like to get miniglx
running with the GLX backend. We can solve the root window issue by modifying
the GLX backend in the following way:
1. Push back extension querying until the first GLX drawable is created. 
2. Only create the root window if pbuffer support is missing and the
application tries to create an offscreen surface before it creates
an onscreen surface. Miniglx applications just have to make sure that
they don't create offscreen surfaces before creating an onscreen one.

More information about the cairo mailing list