예제 #1
0
 def set_vsync(self, vsync):
     if pyglet.options['vsync'] is not None:
         vsync = pyglet.options['vsync']
     self._vsync = vsync  # _recreate depends on this
     swap = c_long(int(vsync))
     agl.aglSetInteger(self._agl_context, agl.AGL_SWAP_INTERVAL,
                       byref(swap))
예제 #2
0
    def attach(self, canvas):
        if self.config._requires_gl_3():
            raise ContextException('AGL does not support OpenGL 3')

        super(CarbonContext, self).attach(canvas)
        if isinstance(canvas, CarbonFullScreenCanvas):
            # XXX not used any more (cannot use AGL_BUFFER_RECT)   
            agl.aglEnable(self._context, agl.AGL_FS_CAPTURE_SINGLE)
            agl.aglSetFullScreen(self._context, canvas.width, canvas.height,
                                 canvas.screen._refresh_rate, 0)
        else:
            agl.aglSetDrawable(self._context, 
                               cast(canvas.drawable, agl.AGLDrawable))
        agl.aglSetCurrentContext(self._context)
        if canvas.bounds is not None:
            bounds = (gl.GLint * 4)(*canvas.bounds)
            agl.aglSetInteger(self._context, agl.AGL_BUFFER_RECT, bounds)
            agl.aglEnable(self._context, agl.AGL_BUFFER_RECT)
        else:
            agl.aglDisable(self._context, agl.AGL_BUFFER_RECT)
        _aglcheck()

        self.set_current()
예제 #3
0
 def set_vsync(self, vsync):
     if pyglet.options['vsync'] is not None:
         vsync = pyglet.options['vsync']
     self._vsync = vsync # _recreate depends on this
     swap = c_long(int(vsync))
     agl.aglSetInteger(self._agl_context, agl.AGL_SWAP_INTERVAL, byref(swap))
예제 #4
0
 def set_vsync(self, vsync=True):
     swap = c_long(int(vsync))
     agl.aglSetInteger(self._context, agl.AGL_SWAP_INTERVAL, byref(swap))
     _aglcheck()
예제 #5
0
 def set_vsync(self, vsync):
     self._vsync = vsync # _recreate depends on this
     swap = c_long(int(vsync))
     agl.aglSetInteger(self._agl_context, agl.AGL_SWAP_INTERVAL, byref(swap))