OpenGL context for drawing.
Use CanvasConfig.create_context to create a context.
Variables: | object_space – An object which is shared between all contexts that share GL objects. |
---|
Constructor:
Methods:
attach(canvas) delete_buffer(buffer_id) Safely delete a buffer object belonging to this context. delete_texture(texture_id) Safely delete a texture belonging to this context. destroy() Release the context. detach() get_info() Get the OpenGL information for this context. set_current()
Attributes:
CONTEXT_SHARE_EXISTING Type: int CONTEXT_SHARE_NONE
Safely delete a buffer object belonging to this context.
This method behaves similarly to delete_texture, though for glDeleteBuffers instead of glDeleteTextures.
Parameters: | buffer_id (int) – The OpenGL name of the buffer to delete. |
---|
Note
Since pyglet 1.1
Safely delete a texture belonging to this context.
Usually, the texture is released immediately using glDeleteTextures, however if another context that does not share this context’s object space is currently active, the deletion will be deferred until an appropriate context is activated.
Parameters: | texture_id (int) – The OpenGL name of the texture to delete. |
---|
Release the context.
The context will not be useable after being destroyed. Each platform has its own convention for releasing the context and the buffer(s) that depend on it in the correct order; this should never be called by an application.
Get the OpenGL information for this context.
Note
Since pyglet 1.2
Return type: | GLInfo |
---|