Welcome to Python-flavored Magnum! Please note that, while already being rather stable, this functionality is still considered experimental and some APIs might get changed without preserving full backwards compatibility.

magnum.gl.Context class

Magnum OpenGL context

Enums

class DetectedDriver: AMD = 1 INTEL_WINDOWS = 4 MESA = 8 NVIDIA = 16 SVGA3D = 32
Detected driver
class Flag: DEBUG = 2 FORWARD_COMPATIBLE = 1 NO_ERROR = 8 ROBUST_ACCESS = 4 NONE = 0
Context flag
class State: BUFFERS = 1 UNBIND_PIXEL_BUFFER = 2 FRAMEBUFFERS = 4 MESHES = 8 MESH_VAO = 16 BIND_SCRATCH_VAO = 32 PIXEL_STORAGE = 64 RENDERER = 128 SHADERS = 256 TEXTURES = 512 TRANSFORM_FEEDBACK = 1024 ENTER_EXTERNAL = 18 EXIT_EXTERNAL = 2013 ALL = 4294967295
State to reset

Methods

def is_version_supported(self, version: Version) -> bool
Get supported OpenGL version
def reset_state(self, states: State = State.ALL) -> None
Reset internal state tracker

Properties

detected_driver: DetectedDriver get
Detected driver
extension_strings: list[str] get
Extension strings
flags: Flag get
Context flags
is_core_profile: bool get
Detect if current OpenGL context is a core profile
owner: object get
Magnum Application owning the context
renderer_string: str get
Renderer string
shading_language_version_string: str get
Shading language version string
shading_language_version_strings: list[str] get
Shading language version strings
vendor_string: str get
Vendor string
version: Version get
OpenGL version
version_string: str get
Version string

Data

current = None
has_current = False