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.Shader class

Shader

Enums

class Type: VERTEX = 35633 TESSELLATION_CONTROL = 36488 TESSELLATION_EVALUATION = 36487 GEOMETRY = 36313 COMPUTE = 37305 FRAGMENT = 35632
Shader type

Methods

def add_file(self, arg0: str, /) -> None
Add shader source file
def add_source(self, arg0: str, /) -> None
Add shader source
def compile(self, /) -> None
Compile shader

Special methods

def __init__(self, version: Version, type: Type) -> None
Constructor

Properties

id: int get
OpenGL shader ID
sources: list[str] get
Shader sources
type: Type get
Shader type

Method documentation

def magnum.gl.Shader.compile(self, /) -> None

Compile shader

Exceptions
RuntimeError If compilation fails