Commit ba2dcc92 authored by sumpfralle's avatar sumpfralle

enable transparency mode for GL


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@683 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 5bf55e8a
...@@ -283,7 +283,7 @@ class ModelViewWindowGL: ...@@ -283,7 +283,7 @@ class ModelViewWindowGL:
# key binding # key binding
self.window.connect("key-press-event", self.key_handler) self.window.connect("key-press-event", self.key_handler)
# OpenGL stuff # OpenGL stuff
glconfig = gtk.gdkgl.Config(mode=gtk.gdkgl.MODE_RGB \ glconfig = gtk.gdkgl.Config(mode=gtk.gdkgl.MODE_RGBA \
| gtk.gdkgl.MODE_DEPTH | gtk.gdkgl.MODE_DOUBLE) | gtk.gdkgl.MODE_DEPTH | gtk.gdkgl.MODE_DOUBLE)
self.area = gtk.gtkgl.DrawingArea(glconfig) self.area = gtk.gtkgl.DrawingArea(glconfig)
# first run; might also be important when doing other fancy # first run; might also be important when doing other fancy
...@@ -488,6 +488,10 @@ class ModelViewWindowGL: ...@@ -488,6 +488,10 @@ class ModelViewWindowGL:
#GL.glColorMaterial(GL.GL_FRONT_AND_BACK, GL.GL_SPECULAR) #GL.glColorMaterial(GL.GL_FRONT_AND_BACK, GL.GL_SPECULAR)
#GL.glColorMaterial(GL.GL_FRONT_AND_BACK, GL.GL_EMISSION) #GL.glColorMaterial(GL.GL_FRONT_AND_BACK, GL.GL_EMISSION)
GL.glEnable(GL.GL_COLOR_MATERIAL) GL.glEnable(GL.GL_COLOR_MATERIAL)
# enable blending/transparency (alpha) for colors
GL.glEnable(GL.GL_BLEND)
# see http://wiki.delphigl.com/index.php/glBlendFunc
GL.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA)
def destroy(self, widget=None, data=None): def destroy(self, widget=None, data=None):
if self.notify_destroy_func: if self.notify_destroy_func:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment