def render(self):
     """Must be called each frame"""
     if not GLX.glXMakeCurrent(self.xdisplay, self.x_window_id, self.context):
         print("failed")
     GL.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT)
     #todo
     GL.glBegin(GL.GL_TRIANGLES)
     GL.glIndexi(0)
     GL.glColor3f(1.0, 0.0, 0.0)
     GL.glVertex2i(0, 1)
     GL.glIndexi(0)
     GL.glColor3f(0.0, 1.0, 0.0)
     GL.glVertex2i(-1, -1)
     GL.glIndexi(0)
     GL.glColor3f(0.0, 0.0, 1.0)
     GL.glVertex2i(1, -1)
     GL.glEnd()
     self.app.render_loop()
     GLX.glXSwapBuffers(self.xdisplay, self.x_window_id)
     self.profiler_window.one_frame_passed()
     return True
 def tkSwapBuffers(self):
     if self.winfo_ismapped():
         GLX.glXSwapBuffers(self.__window, self._wid)
Esempio n. 3
0
 def swap_buffers(self):
     assert self.valid
     GLX.glXSwapBuffers(self.xdisplay, self.xid)
Esempio n. 4
0
 def swap_buffers(self):
     assert self.valid, "GLX window context is no longer valid"
     GLX.glXSwapBuffers(self.xdisplay, self.xid)
Esempio n. 5
0
 def swapbuffers(self):
     GLX.glXSwapBuffers(self.xdisplay, self.xwindow_id)
     #gldrawable = gtk.gtkgl.widget_get_gl_drawable(self)
     #gldrawable.swap_buffers()
     return