def match(self, canvas): if not isinstance(canvas, Win32Canvas): raise RuntimeError('Canvas must be instance of Win32Canvas') # Use ARB API if available if (gl_info.have_context() and wgl_info.have_extension('WGL_ARB_pixel_format')): return self._get_arb_pixel_format_matching_configs(canvas) else: return self._get_pixel_format_descriptor_matching_configs(canvas)
def set_vsync(self, vsync): if wgl_info.have_extension('WGL_EXT_swap_control'): wglext_arb.wglSwapIntervalEXT(int(vsync))
def get_vsync(self): if wgl_info.have_extension('WGL_EXT_swap_control'): return bool(wglext_arb.wglGetSwapIntervalEXT())
def create_context(self, share): if wgl_info.have_extension('WGL_ARB_create_context'): return Win32ARBContext(self, share) else: return Win32Context(self, share)