[GRASS-SVN] r61081 - grass/branches/releasebranch_7_0/gui/wxpython/nviz

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Jun 30 12:53:45 PDT 2014


Author: hcho
Date: 2014-06-30 12:53:45 -0700 (Mon, 30 Jun 2014)
New Revision: 61081

Modified:
   grass/branches/releasebranch_7_0/gui/wxpython/nviz/mapwindow.py
Log:
nviz: backport from trunk (r61053, r61063, ticket #2339)

Modified: grass/branches/releasebranch_7_0/gui/wxpython/nviz/mapwindow.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/nviz/mapwindow.py	2014-06-30 14:49:36 UTC (rev 61080)
+++ grass/branches/releasebranch_7_0/gui/wxpython/nviz/mapwindow.py	2014-06-30 19:53:45 UTC (rev 61081)
@@ -30,7 +30,7 @@
 import wx
 from   wx.lib.newevent import NewEvent
 from   wx              import glcanvas
-from wx.glcanvas       import WX_GL_DEPTH_SIZE
+from wx.glcanvas       import WX_GL_RGBA, WX_GL_DOUBLEBUFFER, WX_GL_DEPTH_SIZE
 
 import grass.script as grass
 from grass.pydispatch.signal import Signal
@@ -80,17 +80,18 @@
         self.lmgr = lmgr
         self.frame = frame
 
+        attribs=[WX_GL_RGBA, WX_GL_DOUBLEBUFFER]
         # for wxGTK we need to set WX_GL_DEPTH_SIZE to draw vectors correctly
         # but we don't know the right value
         # in wxpython 2.9, there is IsDisplaySupported
         if CheckWxVersion(version=[2, 8, 11]) and \
            sys.platform not in ('win32', 'darwin'):
             depthBuffer = int(UserSettings.Get(group='display', key='nvizDepthBuffer', subkey='value'))
-            attribs=[WX_GL_DEPTH_SIZE, depthBuffer, 0]
-            glcanvas.GLCanvas.__init__(self, parent, id, attribList=attribs)
-        else:
-            glcanvas.GLCanvas.__init__(self, parent, id)
+            attribs.extend([WX_GL_DEPTH_SIZE, depthBuffer])
+        attribs.append(0)
 
+        glcanvas.GLCanvas.__init__(self, parent, id, attribList=attribs)
+
         MapWindowBase.__init__(self, parent=parent, giface=giface, Map=Map)
         self.Hide()
 



More information about the grass-commit mailing list