Graphics configuration.
A Config stores the preferences for OpenGL attributes such as the number of auxilliary buffers, size of the colour and depth buffers, double buffering, stencilling, multi- and super-sampling, and so on.
Different platforms support a different set of attributes, so these are set with a string key and a value which is integer or boolean.
Variables: |
|
---|
Constructor:
Create a template config with the given attributes.
Specify attributes as keyword arguments, for example:
template = Config(double_buffer=True)
Methods:
create_context(share) Create a GL context that satisifies this configuration. get_gl_attributes() Return a list of attributes set on this config. is_complete() Determine if this config is complete and able to create a context. match(canvas) Return a list of matching complete configs for the given canvas.
Attributes:
Create a GL context that satisifies this configuration.
Warning
Deprecated. Use CanvasConfig.create_context.
Parameters: | share (Context) – If not None, a context with which to share objects with. |
---|---|
Return type: | Context |
Returns: | The new context. |
Return a list of attributes set on this config.
Return type: | list of tuple (name, value) |
---|---|
Returns: | All attributes, with unset attributes having a value of None. |
Determine if this config is complete and able to create a context.
Configs created directly are not complete, they can only serve as templates for retrieving a supported config from the system. For example, pyglet.window.Screen.get_matching_configs returns complete configs.
Warning
Deprecated. Use isinstance(config, CanvasConfig).
Return type: | bool |
---|---|
Returns: | True if the config is complete and can create a context. |
Return a list of matching complete configs for the given canvas.
Note
Since pyglet 1.2
Parameters: | canvas (Canvas) – Display to host contexts created from the config. |
---|---|
Return type: | list of CanvasConfig |