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.glfw.Application class

GLFW application

Classes

class Configuration
Configuration
class ExitEvent
Exit event
class GLConfiguration
OpenGL context configuration
class InputEvent
Base for input events
class KeyEvent
Key event
class PointerEvent
Pointer event
class PointerMoveEvent
Pointer move event
class ScrollEvent
Scroll event
class ViewportEvent
Viewport event

Enums

class Cursor: ARROW = 0 TEXT_INPUT = 1 CROSSHAIR = 2 RESIZE_NWSE = 3 RESIZE_NESW = 4 RESIZE_WE = 5 RESIZE_NS = 6 RESIZE_ALL = 7 NO = 8 HAND = 9 HIDDEN = 10 HIDDEN_LOCKED = 11
Cursor type
class Key: UNKNOWN = -1 LEFT_SHIFT = 340 RIGHT_SHIFT = 344 LEFT_CTRL = 341 RIGHT_CTRL = 345 LEFT_ALT = 342 RIGHT_ALT = 346 LEFT_SUPER = 343 RIGHT_SUPER = 347 ENTER = 257 ESC = 256 UP = 265 DOWN = 264 LEFT = 263 RIGHT = 262 HOME = 268 END = 269 PAGE_UP = 266 PAGE_DOWN = 267 BACKSPACE = 259 INSERT = 260 DELETE = 261 F1 = 290 F2 = 291 F3 = 292 F4 = 293 F5 = 294 F6 = 295 F7 = 296 F8 = 297 F9 = 298 F10 = 299 F11 = 300 F12 = 301 SPACE = 32 TAB = 258 QUOTE = 39 COMMA = 44 PERIOD = 46 MINUS = 45 PLUS = 43 SLASH = 47 PERCENT = 37 SEMICOLON = 59 EQUAL = 61 LEFT_BRACKET = 91 RIGHT_BRACKET = 93 BACKSLASH = 92 BACKQUOTE = 96 ZERO = 48 ONE = 49 TWO = 50 THREE = 51 FOUR = 52 FIVE = 53 SIX = 54 SEVEN = 55 EIGHT = 56 NINE = 57 A = 65 B = 66 C = 67 D = 68 E = 69 F = 70 G = 71 H = 72 I = 73 J = 74 K = 75 L = 76 M = 77 N = 78 O = 79 P = 80 Q = 81 R = 82 S = 83 T = 84 U = 85 V = 86 W = 87 X = 88 Y = 89 Z = 90 NUM_ZERO = 320 NUM_ONE = 321 NUM_TWO = 322 NUM_THREE = 323 NUM_FOUR = 324 NUM_FIVE = 325 NUM_SIX = 326 NUM_SEVEN = 327 NUM_EIGHT = 328 NUM_NINE = 329 NUM_DECIMAL = 330 NUM_DIVIDE = 331 NUM_MULTIPLY = 332 NUM_SUBTRACT = 333 NUM_ADD = 334 NUM_ENTER = 335 NUM_EQUAL = 336
Key
class Modifier: SHIFT = 1 CTRL = 2 ALT = 4 SUPER = 8
Keyboard modifier
class Pointer: MOUSE_LEFT = 1 MOUSE_MIDDLE = 2 MOUSE_RIGHT = 4 MOUSE_BUTTON4 = 8 MOUSE_BUTTON5 = 16
Pointer
class PointerEventSource: MOUSE = 0
Pointer event source

Methods

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 exit_event(self, arg0: ExitEvent, /) -> None
Exit event
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 pointer_move_event(self, arg0: PointerMoveEvent, /) -> None
Pointer move event
def pointer_press_event(self, arg0: PointerEvent, /) -> None
Pointer press event
def pointer_release_event(self, arg0: PointerEvent, /) -> None
Pointer release event
def redraw(self, /) -> None
Redraw immediately
def scroll_event(self, arg0: ScrollEvent, /) -> None
Scroll event
def swap_buffers(self, /) -> None
Swap buffers
def viewport_event(self, arg0: ViewportEvent, /) -> None
Viewport event
def warp_cursor(self, arg0: Vector2i, /) -> None
Warp mouse cursor to given coordinates

Special methods

def __init__(self, configuration: Configuration = <magnum.platform.glfw.Application.Configuration object at 0x7c0068dfa030>, gl_configuration: GLConfiguration = <magnum.platform.glfw.Application.GLConfiguration object at 0x7c0068d22eb0>) -> None
Constructor

Properties

cursor: Cursor get set
Cursor type
dpi_scaling: Vector2 get
DPI scaling
framebuffer_size: Vector2i get
Framebuffer size
swap_interval: int set
Swap interval
window_size: Vector2i get
Window size