Use glColor instead of mkColor to set GLViewWidget background color.

This commit is contained in:
Kenneth Lyons 2015-07-22 13:13:26 -07:00
parent f0c9cfa96f
commit 9ea38a1270

View File

@ -72,9 +72,9 @@ class GLViewWidget(QtOpenGL.QGLWidget):
def setBackgroundColor(self, *args, **kwds):
"""
Set the background color of the widget. Accepts the same arguments as
pg.mkColor().
pg.mkColor() and pg.glColor().
"""
self.opts['bgcolor'] = fn.mkColor(*args, **kwds)
self.opts['bgcolor'] = fn.glColor(*args, **kwds)
self.update()
def getViewport(self):
@ -174,7 +174,7 @@ class GLViewWidget(QtOpenGL.QGLWidget):
self.setProjection(region=region)
self.setModelview()
bgcolor = self.opts['bgcolor']
glClearColor(bgcolor.red(), bgcolor.green(), bgcolor.blue(), 1.0)
glClearColor(*bgcolor)
glClear( GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT )
self.drawItemTree(useItemNames=useItemNames)