Browse Source

nviz: Add WX_GL_RGBA to the attributes list

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@61063 15284696-431f-4ddb-bdfa-cd5b030d7da7
Huidae Cho 10 years ago
parent
commit
3d29875801
1 changed files with 4 additions and 4 deletions
  1. 4 4
      gui/wxpython/nviz/mapwindow.py

+ 4 - 4
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_DOUBLEBUFFER, 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,15 +80,15 @@ 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_DOUBLEBUFFER, WX_GL_DEPTH_SIZE, depthBuffer, 0]
-        else:
-            attribs=[WX_GL_DOUBLEBUFFER, 0]
+            attribs.extend([WX_GL_DEPTH_SIZE, depthBuffer])
+        attribs.append(0)
 
         glcanvas.GLCanvas.__init__(self, parent, id, attribList=attribs)