diff options
Diffstat (limited to 'silx/gui/plot3d/scene/window.py')
-rw-r--r-- | silx/gui/plot3d/scene/window.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/silx/gui/plot3d/scene/window.py b/silx/gui/plot3d/scene/window.py index ad7e6e5..3c63c7a 100644 --- a/silx/gui/plot3d/scene/window.py +++ b/silx/gui/plot3d/scene/window.py @@ -244,6 +244,7 @@ class Window(event.Notifier): void main(void) { gl_FragColor = texture2D(texture, textureCoord); + gl_FragColor.a = 1.0; } """) @@ -304,12 +305,11 @@ class Window(event.Notifier): self._viewports.removeListener(self._updated) self._viewports = event.NotifierList(iterable) self._viewports.addListener(self._updated) - self._dirty = True + self._updated(self) def _updated(self, source, *args, **kwargs): - if source is not self: - self._dirty = True - self.notify(*args, **kwargs) + self._dirty = True + self.notify(*args, **kwargs) framebufferid = property(lambda self: self._framebufferid, doc="Framebuffer ID used to perform rendering") @@ -323,11 +323,12 @@ class Window(event.Notifier): height, width = self.shape image = numpy.empty((height, width, 3), dtype=numpy.uint8) + previousFramebuffer = gl.glGetInteger(gl.GL_FRAMEBUFFER_BINDING) gl.glBindFramebuffer(gl.GL_FRAMEBUFFER, self.framebufferid) gl.glPixelStorei(gl.GL_PACK_ALIGNMENT, 1) gl.glReadPixels( 0, 0, width, height, gl.GL_RGB, gl.GL_UNSIGNED_BYTE, image) - gl.glBindFramebuffer(gl.GL_FRAMEBUFFER, 0) + gl.glBindFramebuffer(gl.GL_FRAMEBUFFER, previousFramebuffer) # glReadPixels gives bottom to top, # while images are stored as top to bottom |