From 8d9cb79da442b895f6c2a2bdf9c000c076ad64a7 Mon Sep 17 00:00:00 2001 From: Fekete Imre Date: Wed, 31 Jan 2018 23:35:18 +0100 Subject: [PATCH] Fix issue # 366 Set the right texture for rendering, otherwise a previously set texture is overwritten. --- pyqtgraph/opengl/GLViewWidget.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pyqtgraph/opengl/GLViewWidget.py b/pyqtgraph/opengl/GLViewWidget.py index e0fee046bd..71dae9c552 100644 --- a/pyqtgraph/opengl/GLViewWidget.py +++ b/pyqtgraph/opengl/GLViewWidget.py @@ -450,6 +450,7 @@ def renderToArray(self, size, format=GL_BGRA, type=GL_UNSIGNED_BYTE, textureSize glfbo.glFramebufferTexture2D(glfbo.GL_FRAMEBUFFER, glfbo.GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tex, 0) self.paintGL(region=(x, h-y-h2, w2, h2), viewport=(0, 0, w2, h2)) # only render sub-region + glBindTexture(GL_TEXTURE_2D, tex) # fixes issue #366 ## read texture back to array data = glGetTexImage(GL_TEXTURE_2D, 0, format, type)