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.platform.sdl2.Application class

SDL2 application


class Configuration
class GLConfiguration
OpenGL context configuration
class InputEvent
Base for input events
class KeyEvent
Key event
class MouseEvent
Mouse event
class MouseMoveEvent
Mouse move event
class MouseScrollEvent
Mouse scroll event


def draw_event(self, /) -> None
Draw event
def exec(self, /) -> int
Execute application main loop
def exit(self, arg0: int, /) -> None
Exit application main loop
def key_press_event(self, arg0: KeyEvent, /) -> None
Key press event
def key_release_event(self, arg0: KeyEvent, /) -> None
Key release event
def main_loop_iteration(self, /) -> bool
Run one iteration of application main loop
def mouse_move_event(self, arg0: MouseMoveEvent, /) -> None
Mouse move event
def mouse_press_event(self, arg0: MouseEvent, /) -> None
Mouse press event
def mouse_release_event(self, arg0: MouseEvent, /) -> None
Mouse release event
def mouse_scroll_event(self, arg0: MouseScrollEvent, /) -> None
Mouse scroll event
def redraw(self, /) -> None
Redraw immediately
def swap_buffers(self, /) -> None
Swap buffers

Special methods

def __init__(self, configuration: Configuration = <magnum.platform.sdl2.Application.Configuration object at 0x7f7cd113d670>, gl_configuration: GLConfiguration = <magnum.platform.sdl2.Application.GLConfiguration object at 0x7f7cd113d4f0>) -> None


framebuffer_size: Vector2i get
Framebuffer size
swap_interval: int get set
Swap interval
window_size: Vector2i get
Window size