ソースを参照

nviz: backport from trunk (https://trac.osgeo.org/grass/changeset/61053, https://trac.osgeo.org/grass/changeset/61063, ticket https://trac.osgeo.org/grass/ticket/2339)

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@61081 15284696-431f-4ddb-bdfa-cd5b030d7da7
Huidae Cho 10 年 前
コミット
e1fe0e27c8
1 ファイル変更6 行追加5 行削除
  1. 6 5
      gui/wxpython/nviz/mapwindow.py

+ 6 - 5
gui/wxpython/nviz/mapwindow.py

@@ -30,7 +30,7 @@ from threading import Thread
 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,16 +80,17 @@ class GLWindow(MapWindowBase, glcanvas.GLCanvas):
         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()