Merge pull request #102 from jdreaver/develop
Fix OpenGL shader/texture sharing on PySide
This commit is contained in:
commit
1aeb197b03
@ -7,6 +7,8 @@ from .. import functions as fn
|
|||||||
|
|
||||||
##Vector = QtGui.QVector3D
|
##Vector = QtGui.QVector3D
|
||||||
|
|
||||||
|
ShareWidget = None
|
||||||
|
|
||||||
class GLViewWidget(QtOpenGL.QGLWidget):
|
class GLViewWidget(QtOpenGL.QGLWidget):
|
||||||
"""
|
"""
|
||||||
Basic widget for displaying 3D data
|
Basic widget for displaying 3D data
|
||||||
@ -16,14 +18,14 @@ class GLViewWidget(QtOpenGL.QGLWidget):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
ShareWidget = None
|
|
||||||
|
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
if GLViewWidget.ShareWidget is None:
|
global ShareWidget
|
||||||
## create a dummy widget to allow sharing objects (textures, shaders, etc) between views
|
|
||||||
GLViewWidget.ShareWidget = QtOpenGL.QGLWidget()
|
|
||||||
|
|
||||||
QtOpenGL.QGLWidget.__init__(self, parent, GLViewWidget.ShareWidget)
|
if ShareWidget is None:
|
||||||
|
## create a dummy widget to allow sharing objects (textures, shaders, etc) between views
|
||||||
|
ShareWidget = QtOpenGL.QGLWidget()
|
||||||
|
|
||||||
|
QtOpenGL.QGLWidget.__init__(self, parent, ShareWidget)
|
||||||
|
|
||||||
self.setFocusPolicy(QtCore.Qt.ClickFocus)
|
self.setFocusPolicy(QtCore.Qt.ClickFocus)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user