当前位置: 首页>>代码示例>>Python>>正文


Python wgl_info.have_extension函数代码示例

本文整理汇总了Python中pyglet.gl.wgl_info.have_extension函数的典型用法代码示例。如果您正苦于以下问题:Python have_extension函数的具体用法?Python have_extension怎么用?Python have_extension使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了have_extension函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: create_context

 def create_context(self, share):
     # Workaround for issue on certain Intel cards/drivers.
     # TODO: Find out if there is a way to query for this problem
     if wgl_info.have_extension('WGL_ARB_create_context') and gl_info.get_vendor() != 'Intel':
         return Win32ARBContext(self, share)
     else:
         return Win32Context(self, share)
开发者ID:JacquesLucke,项目名称:still-lambda,代码行数:7,代码来源:win32.py

示例2: set_vsync

 def set_vsync(self, vsync):
     if pyglet.options['vsync'] is not None:
         vsync = pyglet.options['vsync']
     if wgl_info.have_extension('WGL_EXT_swap_control'):
         wglext_arb.wglSwapIntervalEXT(int(vsync))
     else:
         warnings.warn('Could not set vsync; unsupported extension.')
开发者ID:AojiaoZero,项目名称:thbattle,代码行数:7,代码来源:__init__.py

示例3: get_matching_configs

    def get_matching_configs(self, template):
        # Determine which technique should be used for finding matching configs.
        # Use the builtin PIXELFORMATDESCRIPTOR if possible, otherwise resort
        # to the WGL_ARB_pixel_format extension.
        need_pixel_format_arb = False
        if template.sample_buffers or template.samples:
            need_pixel_format_arb = True

        if need_pixel_format_arb:
            # Need a GL context before we can query WGL extensions.
            dummy_window = None
            if not gl_info.have_context():
                # Create a dummy context
                config = self.get_best_config()
                context = config.create_context(None)
                dummy_window = Win32Window(visible=False, context=context)

            try:
                # Check for required extensions
                if not wgl_info.have_extension('WGL_ARB_pixel_format'):
                    return []
                return self._get_arb_pixel_format_matching_configs(template)
            finally:
                if dummy_window:
                    dummy_window.close()

        return self._get_pixel_format_descriptor_matching_configs(template)
开发者ID:AojiaoZero,项目名称:thbattle,代码行数:27,代码来源:__init__.py

示例4: match

    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)
开发者ID:odyaka341,项目名称:pyglet,代码行数:9,代码来源:win32.py

示例5: set_vsync

 def set_vsync(self, vsync):
     if wgl_info.have_extension('WGL_EXT_swap_control'):
         wglext_arb.wglSwapIntervalEXT(int(vsync))
开发者ID:JacquesLucke,项目名称:still-lambda,代码行数:3,代码来源:win32.py

示例6: get_vsync

 def get_vsync(self):
     if wgl_info.have_extension('WGL_EXT_swap_control'):
         return bool(wglext_arb.wglGetSwapIntervalEXT())
开发者ID:JacquesLucke,项目名称:still-lambda,代码行数:3,代码来源:win32.py

示例7: create_context

 def create_context(self, share):
     if wgl_info.have_extension('WGL_ARB_create_context'):
         return Win32ARBContext(self, share)
     else:
         return Win32Context(self, share)
开发者ID:izacus,项目名称:pyglet,代码行数:5,代码来源:win32.py

示例8:

if context.__class__.__name__ == 'XlibGLContext':
    from pyglet.gl import glx_info
    print 'GLX %s direct'%(context.is_direct() and 'is' or 'is not')
    if not glx_info.have_version(1, 1):
        print "GLX server version: 1.0"
    else:
        print 'GLX server vendor:', glx_info.get_server_vendor()
        print 'GLX server version:', glx_info.get_server_version()
        print 'GLX server extensions:'
        exts = glx_info.get_server_extensions()
        print ' ', '\n  '.join(textwrap.wrap(' '.join(exts)))
        print 'GLX client vendor:', glx_info.get_client_vendor()
        print 'GLX client version:', glx_info.get_client_version()
        print 'GLX client extensions:'
        exts = glx_info.get_client_extensions()
        print ' ', '\n  '.join(textwrap.wrap(' '.join(exts)))
        print 'GLX extensions:'
        exts = glx_info.get_extensions()
        print ' ', '\n  '.join(textwrap.wrap(' '.join(exts)))
elif context.__class__.__name__ == 'Win32Context':
    from pyglet.gl import wgl_info
    if wgl_info.have_extension('WGL_EXT_extensions_string'):
        wgl_extensions = wgl_info.get_extensions()
        print 'WGL extensions:'
        print '', '\n '.join(textwrap.wrap(' '.join(wgl_extensions)))
    else:
        print 'WGL_EXT_extensions_string extension not available.'

w.close()
开发者ID:izacus,项目名称:pyglet,代码行数:29,代码来源:gl_info.py


注:本文中的pyglet.gl.wgl_info.have_extension函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。