def __enter__(self):
     assert (self._count == 0)
     self.ctx = gtkgl.widget_get_gl_context(self._widget)
     self.surface = gtkgl.widget_get_gl_drawable(self._widget)
     self._begin = self.surface.gl_begin(self.ctx)
     if self._begin:
         self._count += 1
         if self._projection is not None:
             glMatrixMode(GL_PROJECTION)
             glLoadMatrixd(self._projection)
         if self._modelview is not None:
             glMatrixMode(GL_MODELVIEW)
             glLoadMatrixd(self._modelview)
         return self
     return
예제 #2
0
파일: zpr.py 프로젝트: williame/GlestTools
 def __enter__(self):
     assert(self._count == 0)
     self.ctx = gtkgl.widget_get_gl_context(self._widget)
     self.surface = gtkgl.widget_get_gl_drawable(self._widget)
     self._begin = self.surface.gl_begin(self.ctx)
     if self._begin:
         self._count += 1
         if self._projection is not None:
             glMatrixMode(GL_PROJECTION)
             glLoadMatrixd(self._projection)
         if self._modelview is not None:
             glMatrixMode(GL_MODELVIEW)
             glLoadMatrixd(self._modelview)
         return self
     return
예제 #3
0
 def __init__(self, widget):
     self.widget = widget
     self.gldrawable = gtkgl.widget_get_gl_drawable(widget)
     assert self.gldrawable, "failed to get the GL drawable for %s" % widget
     self.glcontext = gtkgl.widget_get_gl_context(widget)
     assert self.glcontext, "failed to get a GL context from %s" % widget
예제 #4
0
 def get_gl_drawable(self):
     return gtkgl.widget_get_gl_drawable(self._backing)
예제 #5
0
 def __exit__(self, exc_type, exc_val, exc_tb):
     gldrawable = gtkgl.widget_get_gl_drawable(self.widget)
     gldrawable.gl_end()
예제 #6
0
 def __enter__(self):
     gldrawable = gtkgl.widget_get_gl_drawable(self.widget)
     glcontext = gtkgl.widget_get_gl_context(self.widget)
     assert gldrawable.gl_begin(glcontext)
예제 #7
0
파일: gtk_compat.py 프로젝트: ljmljz/xpra
 def __exit__(self, exc_type, exc_val, exc_tb):
     gldrawable = gtkgl.widget_get_gl_drawable(self.widget)
     gldrawable.gl_end()
예제 #8
0
파일: gtk_compat.py 프로젝트: ljmljz/xpra
 def __enter__(self):
     gldrawable = gtkgl.widget_get_gl_drawable(self.widget)
     glcontext = gtkgl.widget_get_gl_context(self.widget)
     assert gldrawable.gl_begin(glcontext)
예제 #9
0
 def get_gl_drawable(self):
     return gtkgl.widget_get_gl_drawable(self._backing)
예제 #10
0
 def __init__(self, widget):
     self.widget = widget
     self.gldrawable = gtkgl.widget_get_gl_drawable(widget)
     assert self.gldrawable, "failed to get the GL drawable for %s" % widget
     self.glcontext = gtkgl.widget_get_gl_context(widget)
     assert self.glcontext, "failed to get a GL context from %s" % widget