Fix: GLScatterPlotItem and GLImageItem initializeGL only executed once

This commit is contained in:
2xB 2019-08-15 02:41:51 +02:00
parent ad7453c781
commit 652ae9e64a
2 changed files with 6 additions and 0 deletions

View File

@ -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)

View File

@ -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