SourceForge: pybzedit/pybzedit: changeset 47:9bc5fbbe26ae
update MyGlControl so that the annoying flicker on Linux is gone default tip
authorDavid Lawler <djlawler@aol.com>
Sat Jul 18 16:46:18 2009 -0400 (4 months ago)
changeset 479bc5fbbe26ae
parent 46b13934a69d1e
update MyGlControl so that the annoying flicker on Linux is gone
cpython/MyGlControl.py
     1.1 --- a/cpython/MyGlControl.py	Sat Jul 18 10:47:39 2009 -0400
     1.2 +++ b/cpython/MyGlControl.py	Sat Jul 18 16:46:18 2009 -0400
     1.3 @@ -36,7 +36,11 @@
     1.4  
     1.5      def __init__(self, Parent):
     1.6  
     1.7 -        glcanvas.GLCanvas.__init__(self, Parent, -1)
     1.8 +        glcanvas.GLCanvas.__init__(self, Parent, -1,
     1.9 +                                   attribList=[glcanvas.WX_GL_DOUBLEBUFFER,
    1.10 +                                   glcanvas.WX_GL_RGBA, 0])
    1.11 +        # need to specify WX_GL_DOUBLEBUFFER or you get lots of flicker on Linux
    1.12 +        #glcanvas.GLCanvas.__init__(self, Parent, -1)
    1.13          self.Initialized = False
    1.14          self.LastX = -1
    1.15          self.LastY = -1
    1.16 @@ -387,7 +391,7 @@
    1.17                          bzmap.unselectVisObj(oid)
    1.18                      else:
    1.19                          bzmap.selectVisObj(oid)
    1.20 -                self.Refresh()
    1.21 +                self.Refresh(False)
    1.22              self.topParent.updateTreeViewFromObjects()
    1.23              self.Refresh(False)
    1.24  
    1.25 @@ -430,7 +434,7 @@
    1.26                  center = o.processTransforms(self.topParent.bzmap, center)
    1.27          #print "after, center = " + str(center)
    1.28          self.LookAt = Vector3(center.X, center.Y, center.Z)
    1.29 -        self.Refresh()
    1.30 +        self.Refresh(False)
    1.31  
    1.32      def pickObject(self, X, Y):
    1.33