Surface data

Olly Betts olly at survex.com
Tue Sep 13 12:49:26 BST 2011


On Mon, Sep 12, 2011 at 01:48:46PM +0100, Wookey wrote:
> +++ Stuart Bennett [2011-09-12 12:41 +0100]:
> > "Service Temporarily Unavailable"
> 
> Hmm, so it is  - it was working when I check the URl for you.
> 
> Olly - poking time?

Looks like trac wasn't running for unknown reasons - I've restarted it
now.

> > After more digging the problem appears to be some disagreement about
> > Aven's rendering choices.
> > 
> > GLACanvas::FinishDrawing() calls wxGLCanvas::SwapBuffers() which in
> > turn calls glXSwapBuffers(), to swap the front and back rendering
> > buffers. Unfortunately Aven hasn't requested a double buffered
> > visual, and (admittedly in nonconformity with the spec)
> > glXSwapBuffers doesn't like it.
> > 
> > Changing SwapBuffers() to glFlush() in GLACanvas::FinishDrawing()
> > fixes it (adopting a single buffer rendering model), or changing
> > 	if (!InitGLVisual(NULL)) {
> > in aven.cc to
> > 	int attribList[] = { WX_GL_DOUBLEBUFFER, 1, 0 };
> > 	if (!InitGLVisual(attribList)) {
> > also works by requesting a double buffered visual to start with.
> 
> Cheers for that - sounds like a useful fix.

It seems to be related to the GLX version - for GLX <= 1.2, wx passes
a default attribute list, which includes double buffering.  For GLX >
1.2, it doesn't.

Why is there a 1 in attribList?  WX_GL_DOUBLEBUFFER doesn't appear to
take an argument, and so that 1 means WX_GL_RGBA, which we do want, but
using the constant is clearer.  Did I misunderstand something there?

Anyway, this is what I've committed, which seems to work for me with
GLX 1.2:

http://trac.survex.com/changeset/3623

As a bonus, Aven will now fall back to not using double-buffering, which
won't look so smooth, but is better than not being able to display
anything.

Cheers,
    Olly



More information about the Survex mailing list