Types
Circle = object x*, y*: float32 = 0.0 radius*: float32
Color = object r*, g*, b*, a*: uint8
Event = sdl3.Event
Font = sdl3_ttf.Font
MouseButton = enum mouseLeftButton = 1, mouseMiddleButton = 2, mouseRightButton = 3, mouseBackButton = 4, mouseForwardButton = 5
Text = object x*, y*: float32
Window = ref object title*: string w*, h*: int32 flags*: WindowFlags = 0x0000000000002000'u64 sdlWindow*: sdl3.Window = nil
Consts
IntegerScaling = LOGICAL_PRESENTATION_INTEGER_SCALE
KeyDownEvent: EventType = EVENT_KEY_DOWN
KeyUpEvent: EventType = EVENT_KEY_UP
LetterboxScaling = LOGICAL_PRESENTATION_LETTERBOX
MouseButtonDownEvent: EventType = EVENT_MOUSE_BUTTON_DOWN
MouseButtonUpEvent: EventType = EVENT_MOUSE_BUTTON_UP
NoScaling = LOGICAL_PRESENTATION_DISABLED
OverscanScaling = LOGICAL_PRESENTATION_OVERSCAN
StretchScaling = LOGICAL_PRESENTATION_STRETCH
WindowResizeEvent: EventType = EVENT_WINDOW_RESIZED
Procs
proc createAudioPlayer(): AudioPlayer {....raises: [], tags: [], forbids: [].}
proc createText(renderer: Renderer; text: string; fontPath: string; fontSize: float32; color: Color; x: float32 = 0.0; y: float32 = 0.0): Text {....raises: [KeyError], tags: [], forbids: [].}
proc down(button: MouseButton): bool {....raises: [], tags: [], forbids: [].}
proc drawButton(renderer: Renderer; button: Button): void {....raises: [], tags: [], forbids: [].}
proc drawButtons(renderer: Renderer; buttons: openArray[Button]): void {. ...raises: [], tags: [], forbids: [].}
proc drawCircle(renderer: Renderer; circle: Circle; color: Color; segments: int = 30): void {....raises: [], tags: [], forbids: [].}
proc drawDebugText(renderer: Renderer; text: string; x, y: float32; color: Color): void {. ...raises: [], tags: [], forbids: [].}
proc drawHollowRect(renderer: Renderer; rect: Rect): void {....raises: [], tags: [], forbids: [].}
proc drawHollowRects(renderer: Renderer; rects: openArray[Rect]): void {. ...raises: [], tags: [], forbids: [].}
proc drawPoints(renderer: Renderer; points: openArray[Vector2]; color: Color): void {. ...raises: [], tags: [], forbids: [].}
proc getMonitorSize(): tuple[w, h: int32] {....raises: [], tags: [], forbids: [].}
proc getMousePosition(renderer: Renderer): tuple[x, y: float32] {....raises: [], tags: [], forbids: [].}
proc getPosition(window: Window): tuple[x, y: int32] {....raises: [], tags: [], forbids: [].}
proc getTicksMS(): uint64 {....raises: [], tags: [], forbids: [].}
proc getTicksNS(): uint64 {....raises: [], tags: [], forbids: [].}
proc initAudio(): bool {....raises: [], tags: [], forbids: [].}
proc initCamera(): bool {....raises: [], tags: [], forbids: [].}
proc initEvents(): bool {....raises: [], tags: [], forbids: [].}
proc initGamepad(): bool {....raises: [], tags: [], forbids: [].}
proc initHaptic(): bool {....raises: [], tags: [], forbids: [].}
proc initJoystick(): bool {....raises: [], tags: [], forbids: [].}
proc initSensor(): bool {....raises: [], tags: [], forbids: [].}
proc initText(): bool {....raises: [], tags: [], forbids: [].}
proc initVideo(): bool {....raises: [], tags: [], forbids: [].}
proc loadAudio(audioPlayer: AudioPlayer; path: string): Audio {....raises: [], tags: [], forbids: [].}
proc playAudio(audioPlayer: AudioPlayer; audio: Audio): void {....raises: [], tags: [], forbids: [].}
proc pressed(event: Event; button: Button; renderer: Renderer): bool {. ...raises: [], tags: [], forbids: [].}
proc pressed(event: Event; button: MouseButton): bool {....raises: [], tags: [], forbids: [].}
proc quit(): void {....raises: [], tags: [], forbids: [].}
proc released(event: Event; button: MouseButton): bool {....raises: [], tags: [], forbids: [].}
proc scaleFactor(window: Window): float32 {....raises: [], tags: [], forbids: [].}
proc setAspectRatio(window: Window; min, max: float32): void {....raises: [], tags: [], forbids: [].}
proc setDrawColor(renderer: Renderer; color: Color): void {....raises: [], tags: [], forbids: [].}
proc setFullscreen(window: Window; state: bool): void {....raises: [], tags: [], forbids: [].}
proc setLogicalPixels(renderer: Renderer; w, h: int; mode: ScalingMode): void {. ...raises: [], tags: [], forbids: [].}
proc setPosition(window: Window; x, y: int32): void {....raises: [], tags: [], forbids: [].}
proc setResizable(window: Window; state: bool): void {....raises: [], tags: [], forbids: [].}
proc stopAudio(audioPlayer: AudioPlayer): void {....raises: [], tags: [], forbids: [].}
Exports
-
Equal, End, Two, Key, B, G, ContextMenu, E, RightSuper, Period, LeftSuper, W, Six, Apostrophe, NumpadEnter, Y, Zero, NumpadTwo, Backslash, NumpadNine, Semicolon, NumpadSix, Left, NumpadPlus, A, F10, U, K, LeftAlt, RightCtrl, S, Delete, Three, NumpadZero, Four, Backtick, PrintScreen, X, Insert, F4, Pause, F2, Nine, I, F9, Five, M, Slash, Eight, Up, F7, O, NumpadThree, D, Seven, RightShift, LeftShift, Backspace, Minus, NumpadPeriod, H, RightBracket, ScrollLock, Tab, One, Q, Z, NumLock, Right, F12, LeftBracket, Home, RightAlt, NumpadOne, NumpadMultiply, C, NumpadFive, Escape, J, F1, Enter, Down, T, F8, NumpadMinus, Comma, PageUp, V, Space, CapsLock, R, NumpadDivide, LeftCtrl, NumpadEight, NumpadSeven, NumpadFour, F3, F, F11, N, F5, L, P, F6, PageDown, /, down, one, /, up, +, /=, one, *=, right, +=, right, -, -, *=, zero, -=, up, *, +, *=, +=, *, left, left, Vector2i, *=, -, down, normalized, normalize, *=, Vector2, div, zero, *, *, div, -, *, -=, /=, *, *, *