Esempio n. 1
0
    def _switch_to_impl(self):
        if not self._window:
            return

        if self._glx_1_3:
            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)
Esempio n. 2
0
    def _switch_to_impl(self):
        if not self._window:
            return

        if self._glx_1_3:
            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)
Esempio n. 3
0
    def detach(self):
        if not self.canvas:
            return

        self.set_current()
        gl.glFlush()  # needs to be in try/except?

        super(XlibContext13, self).detach()

        glx.glXMakeContextCurrent(self.x_display, 0, 0, None)
        if self.glx_window:
            glx.glXDestroyWindow(self.x_display, self.glx_window)
            self.glx_window = None
Esempio n. 4
0
    def detach(self):
        if not self.canvas:
            return

        self.set_current()
        gl.glFlush() # needs to be in try/except?

        super(XlibContext13, self).detach()

        glx.glXMakeContextCurrent(self.x_display, 0, 0, None)
        if self.glx_window:
            glx.glXDestroyWindow(self.x_display, self.glx_window)
            self.glx_window = None
Esempio 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()
Esempio n. 6
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()
Esempio n. 7
0
 def set_current(self):
     glx.glXMakeContextCurrent(self.x_display, self.glx_window,
                               self.glx_window, self.glx_context)
     super(XlibContext13, self).set_current()
Esempio n. 8
0
 def set_current(self):
     glx.glXMakeContextCurrent(
         self.x_display, self.glx_window, self.glx_window, self.glx_context)
     super(XlibContext13, self).set_current()