Ejemplo n.º 1
0
    def attach(self, canvas):
        if canvas is self.canvas:  # XXX do this for carbon too?
            return

        super(XlibContext13, self).attach(canvas)

        self.glx_window = glx.glXCreateWindow(self.x_display, self.config._fbconfig, canvas.x_window, None)
        self.set_current()
Ejemplo n.º 2
0
Archivo: xlib.py Proyecto: dee6600/RL
    def attach(self, canvas):
        if canvas is self.canvas:
            return

        super(XlibContext13, self).attach(canvas)

        self.glx_window = glx.glXCreateWindow(
            self.x_display, self.config._fbconfig, canvas.x_window, None)
        self.set_current()
Ejemplo n.º 3
0
    def _OnPaint(self, event):
        if not self._window:
            self._window = self.GetHandle()

            # Can also get the GDK window... (not used yet)
            gdk_window = gdk.gdk_window_lookup(self._window)

            if self._glx_1_3:
                self._glx_window = glx.glXCreateWindow(self._x_display, self._config._fbconfig, self._window, None)
            self.switch_to()
        super(GTKWxCanvas, self)._OnPaint(event)
Ejemplo n.º 4
0
    def _OnPaint(self, event):
        if not self._window:
            self._window = self.GetHandle()

            # Can also get the GDK window... (not used yet)
            gdk_window = gdk.gdk_window_lookup(self._window)

            if self._glx_1_3:
                self._glx_window = glx.glXCreateWindow(self._x_display,
                                                       self._config._fbconfig,
                                                       self._window, None)
            self.switch_to()
        super(GTKWxCanvas, self)._OnPaint(event)
Ejemplo n.º 5
0
    def switch_to(self):
        if self._glx_1_3:
            if not self._glx_window:
                self._glx_window = glx.glXCreateWindow(self._x_display,
                    self._config._fbconfig, self._window, None)
            glx.glXMakeContextCurrent(self._x_display,
                self._glx_window, self._glx_window, self._glx_context)
        else:
            glx.glXMakeCurrent(self._x_display, self._window, self._glx_context)

        self.set_vsync(self._vsync)

        self._context.set_current()
        gl_info.set_active_context()
        glu_info.set_active_context()
Ejemplo n.º 6
0
    def flip(self):
        self.draw_mouse_cursor()

        if self._vsync and self._have_SGI_video_sync and self._use_video_sync:
            count = c_uint()
            glxext_arb.glXGetVideoSyncSGI(byref(count))
            glxext_arb.glXWaitVideoSyncSGI(
                2, (count.value + 1) % 2, byref(count))

        if self._glx_1_3:
            if not self._glx_window:
                self._glx_window = glx.glXCreateWindow(self._x_display,
                    self._config._fbconfig, self._window, None)
            glx.glXSwapBuffers(self._x_display, self._glx_window)
        else:
            glx.glXSwapBuffers(self._x_display, self._window)
Ejemplo n.º 7
0
    def flip(self):
        self.draw_mouse_cursor()

        if self._vsync and self._have_SGI_video_sync and self._use_video_sync:
            count = c_uint()
            glxext_arb.glXGetVideoSyncSGI(byref(count))
            glxext_arb.glXWaitVideoSyncSGI(2, (count.value + 1) % 2,
                                           byref(count))

        if self._glx_1_3:
            if not self._glx_window:
                self._glx_window = glx.glXCreateWindow(self._x_display,
                                                       self._config._fbconfig,
                                                       self._window, None)
            glx.glXSwapBuffers(self._x_display, self._glx_window)
        else:
            glx.glXSwapBuffers(self._x_display, self._window)
Ejemplo n.º 8
0
    def switch_to(self):
        if self._glx_1_3:
            if not self._glx_window:
                self._glx_window = glx.glXCreateWindow(self._x_display,
                                                       self._config._fbconfig,
                                                       self._window, None)
            glx.glXMakeContextCurrent(self._x_display, self._glx_window,
                                      self._glx_window, self._glx_context)
        else:
            glx.glXMakeCurrent(self._x_display, self._window,
                               self._glx_context)

        self.set_vsync(self._vsync)

        self._context.set_current()
        gl_info.set_active_context()
        glu_info.set_active_context()