當前位置: 首頁>>代碼示例>>Python>>正文


Python gl.Config方法代碼示例

本文整理匯總了Python中pyglet.gl.Config方法的典型用法代碼示例。如果您正苦於以下問題:Python gl.Config方法的具體用法?Python gl.Config怎麽用?Python gl.Config使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pyglet.gl的用法示例。


在下文中一共展示了gl.Config方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: get_best_config

# 需要導入模塊: from pyglet import gl [as 別名]
# 或者: from pyglet.gl import Config [as 別名]
def get_best_config(self, template=None):
        '''Get the best available GL config.

        Any required attributes can be specified in `template`.  If
        no configuration matches the template, `NoSuchConfigException` will
        be raised.

        :Parameters:
            `template` : `pyglet.gl.Config`
                A configuration with desired attributes filled in.

        :rtype: `pyglet.gl.Config`
        :return: A configuration supported by the platform that best
            fulfils the needs described by the template.
        '''
        if template is None:
            template = gl.Config()
        configs = self.get_matching_configs(template)
        if not configs:
            raise NoSuchConfigException()
        return configs[0] 
開發者ID:shrimpboyho,項目名稱:flappy-bird-py,代碼行數:23,代碼來源:__init__.py

示例2: get_matching_configs

# 需要導入模塊: from pyglet import gl [as 別名]
# 或者: from pyglet.gl import Config [as 別名]
def get_matching_configs(self, template):
        """Get a list of configs that match a specification.

        Any attributes specified in `template` will have values equal
        to or greater in each returned config.  If no configs satisfy
        the template, an empty list is returned.

        :deprecated: Use :meth:`pyglet.gl.Config.match`.

        :Parameters:
            `template` : `pyglet.gl.Config`
                A configuration with desired attributes filled in.

        :rtype: list of :class:`~pyglet.gl.Config`
        :return: A list of matching configs.
        """
        raise NotImplementedError('abstract') 
開發者ID:pyglet,項目名稱:pyglet,代碼行數:19,代碼來源:base.py

示例3: _init_and_start_app

# 需要導入模塊: from pyglet import gl [as 別名]
# 或者: from pyglet.gl import Config [as 別名]
def _init_and_start_app(self):
        from pyglet.gl import Config
        conf = Config(sample_buffers=1, samples=4,
                      depth_size=24, double_buffer=True,
                      major_version=OPEN_GL_MAJOR,
                      minor_version=OPEN_GL_MINOR)
        super(Viewer, self).__init__(config=conf, resizable=True,
                                     width=self._viewport_size[0],
                                     height=self._viewport_size[1])
        if self.context.config.major_version < 3:
            raise ValueError('Unable to initialize an OpenGL 3+ context')
        clock.schedule_interval(
            Viewer._time_event, 1.0 / self.viewer_flags['refresh_rate'], self
        )
        self.switch_to()
        self.set_caption(self.viewer_flags['window_title'])
        pyglet.app.run() 
開發者ID:musyoku,項目名稱:gqn-dataset-renderer,代碼行數:19,代碼來源:viewer.py

示例4: get_matching_configs

# 需要導入模塊: from pyglet import gl [as 別名]
# 或者: from pyglet.gl import Config [as 別名]
def get_matching_configs(self, template):
        '''Get a list of configs that match a specification.

        Any attributes specified in `template` will have values equal
        to or greater in each returned config.  If no configs satisfy
        the template, an empty list is returned.

        :Parameters:
            `template` : `pyglet.gl.Config`
                A configuration with desired attributes filled in.

        :rtype: list of `pyglet.gl.Config`
        :return: A list of matching configs.
        '''
        raise NotImplementedError('abstract') 
開發者ID:shrimpboyho,項目名稱:flappy-bird-py,代碼行數:17,代碼來源:__init__.py

示例5: config

# 需要導入模塊: from pyglet import gl [as 別名]
# 或者: from pyglet.gl import Config [as 別名]
def config(self):
        """A GL config describing the context of this window.  Read-only.

        :type: :py:class:`pyglet.gl.Config`
        """
        return self._config 
開發者ID:pyglet,項目名稱:pyglet,代碼行數:8,代碼來源:__init__.py

示例6: get_best_config

# 需要導入模塊: from pyglet import gl [as 別名]
# 或者: from pyglet.gl import Config [as 別名]
def get_best_config(self, template=None):
        """Get the best available GL config.

        Any required attributes can be specified in `template`.  If
        no configuration matches the template,
        :class:`~pyglet.window.NoSuchConfigException` will be raised.

        :deprecated: Use :meth:`pyglet.gl.Config.match`.

        :Parameters:
            `template` : `pyglet.gl.Config`
                A configuration with desired attributes filled in.

        :rtype: :class:`~pyglet.gl.Config`
        :return: A configuration supported by the platform that best
            fulfils the needs described by the template.
        """
        configs = None
        if template is None:
            for template_config in [gl.Config(double_buffer=True, depth_size=24, major_version=3, minor_version=3),
                                    gl.Config(double_buffer=True, depth_size=16, major_version=3, minor_version=3),
                                    None]:
                try:
                    configs = self.get_matching_configs(template_config)
                    break
                except window.NoSuchConfigException:
                    pass
        else:
            configs = self.get_matching_configs(template)
        if not configs:
            raise window.NoSuchConfigException()
        return configs[0] 
開發者ID:pyglet,項目名稱:pyglet,代碼行數:34,代碼來源:base.py


注:本文中的pyglet.gl.Config方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。