Merge pull request #1019 from 2xB/fix-1018
Fix: GLScatterPlotItem and GLImageItem initializeGL only executed once
This commit is contained in:
commit
eb7baa3855
@ -29,8 +29,11 @@ class GLImageItem(GLGraphicsItem):
|
||||
GLGraphicsItem.__init__(self)
|
||||
self.setData(data)
|
||||
self.setGLOptions(glOptions)
|
||||
self.texture = None
|
||||
|
||||
def initializeGL(self):
|
||||
if self.texture is not None:
|
||||
return
|
||||
glEnable(GL_TEXTURE_2D)
|
||||
self.texture = glGenTextures(1)
|
||||
|
||||
|
@ -20,6 +20,7 @@ class GLScatterPlotItem(GLGraphicsItem):
|
||||
self.pxMode = True
|
||||
#self.vbo = {} ## VBO does not appear to improve performance very much.
|
||||
self.setData(**kwds)
|
||||
self.shader = None
|
||||
|
||||
def setData(self, **kwds):
|
||||
"""
|
||||
@ -54,6 +55,8 @@ class GLScatterPlotItem(GLGraphicsItem):
|
||||
self.update()
|
||||
|
||||
def initializeGL(self):
|
||||
if self.shader is not None:
|
||||
return
|
||||
|
||||
## Generate texture for rendering points
|
||||
w = 64
|
||||
|
Loading…
Reference in New Issue
Block a user