Skip to content
Snippets Groups Projects
Commit 5041027d authored by Paul McCarthy's avatar Paul McCarthy
Browse files

GLModel background is now transparent on off-screen screenshots. Typo

fix in editor.
parent 7d43cf20
No related branches found
No related tags found
No related merge requests found
...@@ -257,7 +257,7 @@ class Editor(props.HasProperties): ...@@ -257,7 +257,7 @@ class Editor(props.HasProperties):
def _revertChange(self, change): def _revertChange(self, change):
overlay = change.ovelay overlay = change.overlay
opts = self._displayCtx.getOpts(overlay) opts = self._displayCtx.getOpts(overlay)
self._displayCtx.selectOverlay(overlay) self._displayCtx.selectOverlay(overlay)
......
...@@ -314,7 +314,8 @@ def getOSMesaContext(): ...@@ -314,7 +314,8 @@ def getOSMesaContext():
# We follow the same process as for the # We follow the same process as for the
# wx.glcanvas.GLContext, described above # wx.glcanvas.GLContext, described above
dummy = glarrays.GLubyteArray.zeros((640, 480, 43)) dummy = glarrays.GLubyteArray.zeros((640, 480, 43))
thismod._osmesaGLContext = osmesa.OSMesaCreateContext(gl.GL_RGBA, None) thismod._osmesaGLContext = osmesa.OSMesaCreateContextExt(
gl.GL_RGBA, 8, 4, 0, None)
osmesa.OSMesaMakeCurrent(thismod._osmesaGLContext, osmesa.OSMesaMakeCurrent(thismod._osmesaGLContext,
dummy, dummy,
gl.GL_UNSIGNED_BYTE, gl.GL_UNSIGNED_BYTE,
......
...@@ -207,6 +207,8 @@ class GLModel(globject.GLObject): ...@@ -207,6 +207,8 @@ class GLModel(globject.GLObject):
self._renderTexture.bindAsRenderTarget() self._renderTexture.bindAsRenderTarget()
self._renderTexture.setRenderViewport(xax, yax, lo, hi) self._renderTexture.setRenderViewport(xax, yax, lo, hi)
gl.glClearColor(0, 0, 0, 0)
gl.glClear(gl.GL_COLOR_BUFFER_BIT) gl.glClear(gl.GL_COLOR_BUFFER_BIT)
gl.glClear(gl.GL_DEPTH_BUFFER_BIT) gl.glClear(gl.GL_DEPTH_BUFFER_BIT)
gl.glClear(gl.GL_STENCIL_BUFFER_BIT) gl.glClear(gl.GL_STENCIL_BUFFER_BIT)
...@@ -249,8 +251,9 @@ class GLModel(globject.GLObject): ...@@ -249,8 +251,9 @@ class GLModel(globject.GLObject):
gl.GL_UNSIGNED_INT, gl.GL_UNSIGNED_INT,
indices) indices)
# third pass - render the intersection of the # third pass - render the intersection
# front and back faces from the stencil buffer # of the front and back faces from the
# stencil buffer to the render texture
gl.glColorMask(gl.GL_TRUE, gl.GL_TRUE, gl.GL_TRUE, gl.GL_TRUE) gl.glColorMask(gl.GL_TRUE, gl.GL_TRUE, gl.GL_TRUE, gl.GL_TRUE)
gl.glDisable(gl.GL_CLIP_PLANE0) gl.glDisable(gl.GL_CLIP_PLANE0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment