Eric Wilhelm wrote:

  Hi,

I'm not sure where the difference is here between my desktop (debian etch running xinerama on 2 nvidia cards) and laptop (debian lenny running etch on a radeon card), but somehow Wx::GLCanvas doesn't come out double-buffered by default on my desktop.

These are all the same on both machines:

  Wx            => 0.86
  Wx::wxVERSION => 2.006003     # also tried with 2.8.7
  Wx::GLCanvas  => 0.07
  OpenGL        => 0.54, 0.56   # 0.57 won't build

And there are probably ten or so other factors involved, but I've found that I can do this in GLCanvas.xs and get a double-buffered canvas, so I'm not sure who is at fault or what needs to change:

int attrib[] = {WX_GL_DOUBLEBUFFER};
RETVAL = new wxGLCanvas( parent, id, pos, size, style, name, attrib);

(I know they say double-buffering doesn't work with xinerama, but with that set it works -- the redraw flicker goes away and OpenGL::glGetBooleanv_p(GL_DOUBLEBUFFER) turns from false to true!)

So, should this change be made in Wx::GLCanvas or is there something I should be doing to my configuration instead?

  I do not know if you can do anything to your configuration, but
as far as wxGLCanvas is concerned I'd add the ability
for the user to pass the attribute list rather than forcing double
buffering on everybody.

  [... coding happens ...]

  In fact if you check out wxGLCanvas trunk at
http://wxperl.svn.sourceforge.net/svnroot/wxperl/wxGLCanvas/trunk
I just added an array parameter for the attributes; no constants yet,
and only tested on Mac.  See example below.

Regards,
Mattia

Index: lib/Wx/DemoModules/wxGLCanvas.pm
===================================================================
--- lib/Wx/DemoModules/wxGLCanvas.pm    (revisione 2060)
+++ lib/Wx/DemoModules/wxGLCanvas.pm    (copia locale)
@@ -23,7 +23,8 @@

 sub new {
     my( $class, $parent ) = @_;
-    my $self = $class->SUPER::new( $parent );
+    my $self = $class->SUPER::new( $parent, -1, [-1, -1], [-1, -1], 0,
+                                   "GLCanvas", [1, 4, 0] );

     my $timer = $self->timer( Wx::Timer->new( $self ) );
     $timer->Start( 50 );

Reply via email to